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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fef3ad775ef4b0b7 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!193.252.117.184.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <48F76B45.1050403@obry.net> Date: Thu, 16 Oct 2008 18:26:45 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada To: amado.alves@gmail.com Subject: Re: Ada for 1st year students References: <60e0c5f0-1e17-4add-b21e-b1ef622d5233@v13g2000pro.googlegroups.com> <01b1f1e3-02eb-4a2a-88a3-5650f114a227@v39g2000pro.googlegroups.com> <48EE710D.7080109@obry.net> <417af75d-56a0-44f3-b214-35c6603235e6@r38g2000prr.googlegroups.com> <014b15d2-fe7c-4eeb-9366-7c92ef07efe2@f40g2000pri.googlegroups.com> <74dc9192-deff-43fd-a5ef-fa9abd92e1e2@25g2000prz.googlegroups.com> <2fad3f37-3b68-48cf-97aa-21c843815431@i18g2000prf.googlegroups.com> <48f629ad$0$6577$9b4e6d93@newsspool4.arcor-online.net> <956de137-8a05-405d-ad1d-28540ca2fe58@q26g2000prq.googlegroups.com> <3b7e4d13-85fd-4f5c-a619-32f521e102cf@m73g2000hsh.googlegroups.com> In-Reply-To: <3b7e4d13-85fd-4f5c-a619-32f521e102cf@m73g2000hsh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 16 Oct 2008 18:26:46 CEST NNTP-Posting-Host: 83.199.37.111 X-Trace: 1224174406 news.orange.fr 964 83.199.37.111:6911 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:2426 Date: 2008-10-16T18:26:46+02:00 List-Id: amado.alves@gmail.com a �crit : > Largest count of -I switches I've ever seen is around ten. I can count a single one if I put all the sources into the same directory. This is just bad design. If you have modules for subsystems then you'll have very soon lot of -I and -L... And you'll also have to manage the linker library order (not that trivial)... > Even so I think I prefer a single gnatmake command. Me too: $ gnatmake -P myapp Don't tell me that: $ gnatmake -Ithis -Ithat/there/whatever -Iand/again/here main.adb \ -largs -llibfoo -llibbar -llibwhatever -bargs -E is easier to read, maintain and understand :) > The hard part is finding out the paths anyway. That no hard path. The project file does this for you. I think you do not understand the project facility at all. Let's have a simple example: application/ appli.gpr src obj module1/ module1.gpr src obj lib module2/ module2.gpr src1 src2 obj file: module1.gpr project Module1 is for Source_Dirs use ("src"); for Object_Dir use "obj"; for Library_Name use "mod1"; for Library_Kind use "relocatable"; end Module1; file: module2.gpr project Module1 is for Source_Dirs use ("src1", "src2"); for Object_Dir use "obj"; end Module1; file: appli.gpr with "module1/module1"; with "module2/module2"; with "gtkada"; with "aws"; project Appli is for Source_Dirs use ("src"); for Object_Dir use "obj"; for Main use ("runme.adb"); end Appli; Then to build appli: $ gnatmake -Pappli It will build a relocatable library (and yes this is portable to Win32 or UNIXes) named libmod1.so, a set of sources from module2, a set of sources from main application and will then link your executable with is based on module1, module1 and GtkAda plus AWS. All the linker arguments will be passed correctly and in the proper order, this just by calling: $ gnatmake -Pappli So what? So, except for anything simple with 2 or 3 sources I do create a project file. BTW, GPS has the notion of default project created automatically to handle sources in the the run directory. I hope this will dismiss all misconception about project file :) Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595