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-Google-Thread: 103376,163994d4f34e92d0 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.227.67 with SMTP id ry3mr1872250pbc.8.1343586941636; Sun, 29 Jul 2012 11:35:41 -0700 (PDT) Path: c10ni48523pbw.0!nntp.google.com!news1.google.com!postnews.google.com!n33g2000vbi.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Newsgroups: comp.lang.ada 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) Organization: http://groups.google.com Message-ID: <076bab1d-77cd-4c81-80c1-ae1500b4801b@n33g2000vbi.googlegroups.com> References: NNTP-Posting-Host: 79.138.159.146 Mime-Version: 1.0 X-Trace: posting.google.com 1343586941 4194 127.0.0.1 (29 Jul 2012 18:35:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 29 Jul 2012 18:35:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n33g2000vbi.googlegroups.com; posting-host=79.138.159.146; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-07-29T11:33:46-07:00 List-Id: On 29 Juli, 11:31, "Nasser M. Abbasi" wrote: > I have =A0--+---src/main1.adb, main2.adb > =A0 =A0 =A0 =A0 =A0 =A0| > =A0 =A0 =A0 =A0 =A0 =A0+---obj/ > =A0 =A0 =A0 =A0 =A0 =A0| > =A0 =A0 =A0 =A0 =A0 =A0+---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/ =A0directory. > 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=F6rn Lundin