comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Have one GPR file build another with external variables
Date: Sun, 31 May 2020 11:42:26 -0700 (PDT)
Date: 2020-05-31T11:42:26-07:00	[thread overview]
Message-ID: <86d979cf-646b-4ead-b309-92e29f8fc865@googlegroups.com> (raw)
In-Reply-To: <lyd06laz15.fsf@pushface.org>

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.

      reply	other threads:[~2020-05-31 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 16:59 Have one GPR file build another with external variables Jere
2020-05-30 17:17 ` Dmitry A. Kazakov
2020-05-30 18:48   ` Jere
2020-05-30 19:29     ` Dmitry A. Kazakov
2020-05-30 21:33     ` Simon Wright
2020-05-31 18:42       ` Jere [this message]
replies disabled

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