From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.160.197 with SMTP id xm5mr26520699pab.3.1449478919852; Mon, 07 Dec 2015 01:01:59 -0800 (PST) X-Received: by 10.182.42.195 with SMTP id q3mr259274obl.3.1449478919780; Mon, 07 Dec 2015 01:01:59 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!mv3no12786962igc.0!news-out.google.com!f6ni16557igq.0!nntp.google.com!mv3no10118996igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 7 Dec 2015 01:01:59 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.117.194.28; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 97.117.194.28 References: <2c68ffdd-f55e-4c68-84f1-fbe0f83a0b57@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5ba1035b-7ffa-4ea8-b9cd-fde589b99904@googlegroups.com> Subject: Re: How to compile Barnes' examples from his book using GNAT From: Jerry Injection-Date: Mon, 07 Dec 2015 09:01:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:28676 Date: 2015-12-07T01:01:59-08:00 List-Id: 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: >=20 > > 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. >=20 > It should be as simple as "gnatmake main_program.adb". >=20 > In fact it isn't ... quite. Taking the first on that list, XPROG6.txt for= =20 > example, I see that it has to be split into .ads files for each package,= =20 > and matching .adb files for each package body and the main program. >=20 > Tedious ... except there's a tool called "gnatchop" to do that. >=20 > So,=20 > gnatchop XPROG6.txt > gnatmake tower_of_hanoi.adb >=20 > Job done. >=20 > -- 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 t= hey make multiple package specs and bodies in one file then let gnatchop ha= ndle 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