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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: How to compile Barnes' examples from his book using GNAT Date: Sun, 6 Dec 2015 11:24:21 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <2c68ffdd-f55e-4c68-84f1-fbe0f83a0b57@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 6 Dec 2015 11:24:21 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="da745e888d4a5182b5fda6212bbb0a63"; logging-data="31384"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tdcZ5mvR9bN9rEg3GlhwpEjnHO/Ddn3I=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:CZrLHd71hi3jYx9DLmnTUm+qDJg= Xref: news.eternal-september.org comp.lang.ada:28662 Date: 2015-12-06T11:24:21+00:00 List-Id: 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