comp.lang.ada
 help / color / mirror / Atom feed
From: "björn lundin" <b.f.lundin@gmail.com>
Subject: Re: how to tell gnatmake to send executables to a different directory when compiling multi source?
Date: Sun, 29 Jul 2012 11:33:46 -0700 (PDT)
Date: 2012-07-29T11:33:46-07:00	[thread overview]
Message-ID: <076bab1d-77cd-4c81-80c1-ae1500b4801b@n33g2000vbi.googlegroups.com> (raw)
In-Reply-To: jv2vu5$9tm$1@speranza.aioe.org

On 29 Juli, 11:31, "Nasser M. Abbasi" <n...@12000.org> wrote:
> I have  --+---src/main1.adb, main2.adb
>            |
>            +---obj/
>            |
>            +---bin/
>
> In src/ I have few Ada main programs. I can build all and tell gnatmake
> to send the *.o and *.ali to the obj/ directory using -D switch.
>
> But not able to find an option to tell it send the generated
> executable (main1.exe and main2.exe) to bin/  directory.
>

I maintain a largish system, with 60+ executables,
some libraries written in C/C++,
linking with db-libraries
on AIX, Windows and now Linux.

The system was ported to gnat in 2002 by me, and at that time I found
gpr files to be
way to clumpsy. So I ended up with writing a frontend to gnatmake and
gcc that
* traversed the source dirs and created dummy ali files for each adb
and ads file.
* keeping a textfile as a 'ada library' ie, ability to have several
object directories

the frontend traverses the library file and builds a path of valid src
dirs and object dirs
and sets the ADA_INCLUDE_PATH resp ADA_OBJECT_PATH env vars.

by invoking the frontend from the correct/wanted target directory,
the frontend sets the env-vars, and runs gnatmake with a switch to
honor the exiting, but empty, ali-files
and links the exefile at the wanted location. the object files ends up
in their correct locations.
The only drawback is b* files generated by gnatbind. but the frontend
moves them to the obj directory when the exe is created.

This was driven by kornshell and bat files until a year ago, when I
started to build on Linux.
The kornshells (AIX) were not quite compatible with linux kornshell,
so I scrapped that double implemenation
and it is now driven by makefiles (yes recursive). One set of
makefiles for all platforms.

That is a ksh or bat calls the frontend, written in tcl, that calls
gnatmake.


it is stable and works very well.

If I would do it again, today? No.
Since that decision 10 years ago, gpr files has matured a lot.

I would use gpr, but I'd still use make to drive all compilation.
We also have some copying of different files to do, and auto
generation of some souce code (Ada),
and gpr does not handle that.

Main reason to use gpr today would be c.l.a, where there are many
experts on gpr.
lots of help to get. With your own tools, you are on your own.
Also eclipse/gps requires the use of gpr.



/Björn Lundin






























  parent reply	other threads:[~2012-07-29 18:35 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29  9:31 how to tell gnatmake to send executables to a different directory when compiling multi source? Nasser M. Abbasi
2012-07-29 10:00 ` Dmitry A. Kazakov
2012-07-29 11:35   ` Nasser M. Abbasi
2012-07-29 12:29     ` Patrick
2012-07-29 13:02       ` Nasser M. Abbasi
2012-07-29 13:49         ` Ludovic Brenta
2012-07-29 14:09           ` Nasser M. Abbasi
2012-07-29 15:35             ` Ludovic Brenta
2012-07-29 15:42               ` Patrick
2012-07-29 16:41                 ` Ludovic Brenta
2012-07-29 16:46                   ` Patrick
2012-07-29 17:35               ` Vasiliy Molostov
2012-07-29 19:40                 ` Dmitry A. Kazakov
2012-07-29 22:22                   ` Vasiliy Molostov
2012-07-29 19:46                 ` Robert A Duff
2012-07-30  0:20                   ` Vasiliy Molostov
2012-07-30  3:01                     ` Nasser M. Abbasi
2012-07-30  4:48                       ` Nasser M. Abbasi
2012-07-30 21:05                         ` Robert A Duff
2012-07-30  5:50                       ` Dmitry A. Kazakov
2012-07-30 11:16                       ` Vasiliy Molostov
2012-07-30 12:25                         ` Georg Bauhaus
2012-07-30 12:59                           ` Vasiliy Molostov
2012-07-30 14:07                             ` Georg Bauhaus
2012-07-30 13:03                           ` Nasser M. Abbasi
2012-07-30 14:02                             ` Georg Bauhaus
2012-07-30 19:40                             ` J-P. Rosen
2012-08-01  7:32                               ` Miles Bader
2012-08-01  9:37                                 ` Ludovic Brenta
2012-08-02  5:01                                   ` Miles Bader
2012-08-01 15:15                                 ` J-P. Rosen
2012-08-02 15:08                                   ` Robert A Duff
2012-08-02 16:37                                     ` J-P. Rosen
2012-07-30 19:50                             ` Ludovic Brenta
2012-07-30  3:21                     ` Nasser M. Abbasi
2012-07-30  8:19                       ` Simon Wright
2012-07-30  6:12                     ` Dirk Heinrichs
2012-07-30  6:40                     ` Ludovic Brenta
2012-07-30 10:31                       ` Vasiliy Molostov
2012-07-30 11:05                         ` Ludovic Brenta
2012-07-30 11:33                           ` Simon Wright
2012-07-30 12:16                           ` Vasiliy Molostov
2012-07-30 12:48                             ` Ludovic Brenta
2012-07-30 13:09                               ` Vasiliy Molostov
2012-07-30  6:06                 ` Dirk Heinrichs
2012-07-29 12:31     ` Nasser M. Abbasi
2012-07-29 13:46       ` Ludovic Brenta
2012-07-29 14:15         ` Simon Wright
2012-07-29 13:54     ` Dmitry A. Kazakov
2012-07-29 14:16       ` Nasser M. Abbasi
2012-07-29 14:32         ` Dmitry A. Kazakov
2012-07-30  5:57     ` General purpose build tools (was: Re: how to tell gnatmake to send executables to a different directory when compiling multi source?) Dirk Heinrichs
2012-07-30 10:50       ` Vasiliy Molostov
2012-07-30 11:10         ` Ludovic Brenta
2012-07-30 12:39           ` Vasiliy Molostov
2012-08-30 10:49           ` General purpose build tools Stephen Leake
2012-07-29 18:33 ` björn lundin [this message]
2012-07-29 19:06 ` how to tell gnatmake to send executables to a different directory when compiling multi source? onox
2012-07-31 11:12 ` Patrick
2012-07-31 11:30   ` Dmitry A. Kazakov
2012-07-31 11:31     ` Dmitry A. Kazakov
2012-07-31 11:34       ` Patrick
2012-07-31 12:33   ` Ludovic Brenta
2012-07-31 15:14     ` Patrick
2012-07-31 16:04       ` Ludovic Brenta
replies disabled

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