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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ae9:e10f:: with SMTP id g15mr17431611qkm.285.1590950547428; Sun, 31 May 2020 11:42:27 -0700 (PDT) X-Received: by 2002:a9d:71d6:: with SMTP id z22mr3988850otj.81.1590950547130; Sun, 31 May 2020 11:42:27 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 31 May 2020 11:42:26 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=70.109.61.125; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.125 References: <906b9ee8-19be-4fd0-8ba7-f7af5823bd56@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <86d979cf-646b-4ead-b309-92e29f8fc865@googlegroups.com> Subject: Re: Have one GPR file build another with external variables From: Jere Injection-Date: Sun, 31 May 2020 18:42:27 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58906 Date: 2020-05-31T11:42:26-07:00 List-Id: On Saturday, May 30, 2020 at 5:33:30 PM UTC-4, Simon Wright wrote: > If you're only concerned wih runtimes, you could maybe look at > _installing_ the runtime in different locations depending on the > release/debug mode? > > For Cortex GNAT RTS I use this style in build_runtime.gpr, to install > either with the compiler (not that I ever do!) or in > ~/cortex-gnat-rts/local/stm32f4 (for example). All the source files in > the runtime source end up in the one adainclude/ directory. > > package Install is > case Common.Local is > when "no" => > for Prefix use "arm-eabi/lib/gnat/"; > when "yes" => > for Prefix use project'Project_Dir & "../local/"; > end case; > for Prefix use Install'Prefix & "stm32f4"; > for Sources_Subdir use "adainclude"; > for Ali_Subdir use "adalib"; > for Lib_Subdir use "adalib"; > for Required_Artifacts (".") use ("runtime.xml"); > for Required_Artifacts ("adalib") use ("adalib/stm32f407-flash.ld"); > for Install_Project use "false"; > end Install; > > Common.Local is set by the scenario variable INSTALL_LOCALLY, but you > could equally use your BUILD variable, so that the RTS would end up in > /some/path/debug or /some/path/release, and your project would pick up > its runtime from whichever. Wouldn't even have to use the same build > variable in project and RTS, so long as the projject knows where to > look. I appreciate this and I actually started out with something similar to this. Every time I needed to make an adjustment to the runtime, I had to rebuild the runtime twice, re-install it twice, and then rebuild the library too. I'm trying to get to a single gprbuild command on the library GPR file that both forces the runtime to be rebuilt and also is able to pass an external variable to that build process. I want something like: gprbuild my_library.gpr -xBUILD=debug to essentially replace my gprbuild my_runtime.gpr -xBUILD=debug gprbuild my_library.gpr -xBUILD=debug (NOTE: Inside of my_library.gpr, I specify the runtime as the one for my_runtime.gpr so it knows where it is). So that every time I make an adjustment to the library or the runtime (I'm working on both at the same time), I don't have so many steps to do for compilation. I currently use a make file to do this, but I was hoping I could add something to my_library.gpr to tell it to rebuild my_runtime.gpr and specify the external variables needed for that build process. It may not be possible, I'm just checking to see if gprbuild has some sort of aspect or similar to tell it to rebuild the runtime and also specify the variables needed for that build.