From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Bj=c3=b6rn_Lundin?= Newsgroups: comp.lang.ada Subject: Re: Suggestion about best practice with .gpr files Date: Fri, 4 Jun 2021 09:48:03 +0200 Organization: A noiseless patient Spider Message-ID: References: <861r9met5p.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 4 Jun 2021 07:48:04 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7aa8efa425d76d53ba0326c306e9ed9a"; logging-data="30138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18pEnMvW2eWaSoo7f5RK9MG" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 Cancel-Lock: sha1:liSp7/TF3yojPej2yw1M7BGAS0A= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62114 List-Id: Den 2021-06-01 kl. 11:33, skrev Jeffrey R. Carter: > The compiler knows the dependencies among the units that make up a > project, and every compiler I've used has the ability to do a build, > recompiling units that need it, so there is no need for an additional > tool to do this, as there is with C. I can tell that you never used Alsys Ada on Aix then. It would tell you if a file was obsolete - which it became by * changing it * compile its spec (if it was a body) * compile a spec which it directly or indirectly is dependent on so - just by compiling some spec, you would obsolete another body. And there was no such thing as recompilation. So the whole system was built with korn-shell files stating ada compile file_a_spec.ada ada compile file_b_spec.ada ada compile file_c_spec.ada ada compile file_a_body.ada ada compile file_b_body.ada ada compile file_c_body.ada and if file_a_spec.ada later on did a 'with' on file_b_spec.ada you would need to change that korn-shell script to read ada compile file_b_spec.ada ada compile file_a_spec.ada ada compile file_c_spec.ada ... instead For windows we had Object Ada (7.?) It would recompile all file if they belonged to the same object libraray. We have a hierchal structrure so we can compile code (common utilities) into a root object librery, and application specific code to children of that root if you did changed in application layer, it would recompile changes in that layer - but not in the root layer. So - we had to have corresponding bat files stating ada compile file_a_spec.ada .... So migrating to Gnat was a great relief. We did use the -i switch of gnatmake and 2000 lines of tcl-glue code to get the object files where we wanted them; to krep the hierchal structure. Worked very well for 15 years, then project files were good enough to support all our requirements. We now have basically just a bash-script calling on gprbuild with 15-20 gprfiles. much simpler. And the syntax for setting switches is great we support AIX 5,6,7 Win 2003,2008,20012,2016,2019 32/64 bit Linux debain/ubuntu/redhat/centos on intel64 and arm64 and some playing around with Freeebsd/macp-pc32/mac-intel64 on that we support Oracle/Postgressql/MS-sql-server And 3 different ways of doing IPC (pipes/sem+shared mem/rabbitMQ) and 15-20 different flavours of gnat (mostly pro, but also GPL and FSF on some platforms) Sofar we only deliver on gnat pro, but I test with GPL and FSF as well. So - the scenario handling of gpr file is just great, the above will give you quite some combinations. and some code cannot be compiled on all platforms, like big-endian/little-endian record layouts. Controlling source-file directories via gpr is much easier than anything we had before. So - yes if you have small projects - fine you don't need project files. if you have millions of lines of code - then you tend to like them. -- Björn