comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: How to compile Barnes' examples from his book using GNAT
Date: Mon, 7 Dec 2015 01:01:59 -0800 (PST)
Date: 2015-12-07T01:01:59-08:00	[thread overview]
Message-ID: <5ba1035b-7ffa-4ea8-b9cd-fde589b99904@googlegroups.com> (raw)
In-Reply-To: <n415t5$uko$2@dont-email.me>

On Sunday, December 6, 2015 at 4:26:49 AM UTC-7, Brian Drummond wrote:
> On Sun, 06 Dec 2015 02:49:23 -0800, Jerry wrote:
> 
> > How does one compile Barnes' examples from his book, Programming in Ada
> > 2012, with GNAT? The programs are available here: cambridge.org/barnes
> > -> Resources -> Programs.
> 
> It should be as simple as "gnatmake main_program.adb".
> 
> In fact it isn't ... quite. Taking the first on that list, XPROG6.txt for 
> example, I see that it has to be split into .ads files for each package, 
> and matching .adb files for each package body and the main program.
> 
> Tedious ... except there's a tool called "gnatchop" to do that.
> 
> So, 
> gnatchop XPROG6.txt
> gnatmake tower_of_hanoi.adb
> 
> Job done.
> 
> -- Brian

Thanks, Brian. I was kind of aware of this limitation of GNAT. This makes a mess of things. Is there a preferred way that GNAT users handle this? Do they make multiple package specs and bodies in one file then let gnatchop handle it, possibly hiding the mess in another directory, or is it preferred to write the many separate spec and body files from the start?

Jerry

  parent reply	other threads:[~2015-12-07  9:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 10:49 How to compile Barnes' examples from his book using GNAT Jerry
2015-12-06 11:24 ` Brian Drummond
2015-12-06 18:17   ` Jeffrey R. Carter
2015-12-06 21:21     ` Pascal Obry
2015-12-06 22:33       ` Jeffrey R. Carter
2015-12-08  2:01         ` Randy Brukardt
2015-12-07  9:01   ` Jerry [this message]
2015-12-07  9:36     ` Jacob Sparre Andersen
2015-12-10  3:26       ` Jerry
2015-12-10  8:55         ` J-P. Rosen
2015-12-10 12:34           ` G.B.
2015-12-07 14:21     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox