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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,163994d4f34e92d0,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.219.205 with SMTP id hv13mr1587212qab.5.1343789445235; Tue, 31 Jul 2012 19:50:45 -0700 (PDT) Received: by 10.66.82.2 with SMTP id e2mr3454090pay.40.1343789445127; Tue, 31 Jul 2012 19:50:45 -0700 (PDT) Path: a15ni13561295qag.0!nntp.google.com!r1no8392777qas.0!news-out.google.com!p10ni9631378pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: how to tell gnatmake to send executables to a different directory when compiling multi source? Date: Sun, 29 Jul 2012 04:31:51 -0500 Organization: Aioe.org NNTP Server Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: 9ii5QNw33OfeoTzEH8w9ug.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-29T04:31:51-05:00 List-Id: 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. Otherwise, it will put them in src/ For example, when in src/ directory, I type gnatmake -D ../obj *.adb But I can't write something like gnatmake -D ../obj -o../bin/ *.adb Since it is a multi-file gnatmake call: "gnatmake: cannot specify a single executable for several mains" (it is actually think ../bin/ above is a name of a 'file') If I want to use gnatmake from the command line, I would have to write gnatmake -D ../obj -o../bin/main1.exe main1.adb gnatmake -D ../obj -o../bin/main2.exe main2.adb I looked at all options here http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Switches-for-gnatmake.html#Switches-for-gnatmake May be I missed it. Any one knows a trick to do this? ps. I can do the above using a Makefile, using a rule, so I do not have to type the above gnatmake command for each file ofcourse, as Makefile will do it for me, using wildcard. I am just interested to see if it is possible using a switch, that is all. thanks --Nasser ps. I know gpr is supposed to be used for Ada, may be later when I learn, but for now, I am using gnatmake.