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,9c58c5788b715fa0,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h48g2000cwc.googlegroups.com!not-for-mail From: "evangeli@cnam.fr" Newsgroups: comp.lang.ada Subject: compiling C files with gnat project files Date: 13 Nov 2006 05:47:40 -0800 Organization: http://groups.google.com Message-ID: <1163425660.255360.210170@h48g2000cwc.googlegroups.com> NNTP-Posting-Host: 163.173.48.11 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1163425665 8537 127.0.0.1 (13 Nov 2006 13:47:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 13 Nov 2006 13:47:45 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); fr; rv:1.8.0.7) Gecko/20060911 SUSE/1.5.0.7-1.5 Firefox/1.5.0.7,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 cache2.cnam.fr:3128 (squid/2.5.STABLE5) Complaints-To: groups-abuse@google.com Injection-Info: h48g2000cwc.googlegroups.com; posting-host=163.173.48.11; posting-account=5dlFbAwAAAAf9N8cARqQjYujaztxzGdq Xref: g2news2.google.com comp.lang.ada:7425 Date: 2006-11-13T05:47:40-08:00 List-Id: Hello, I am trying to use gnat project files in my project which contains some Ada and C files. I have the following tree : --========== src/ helena.gpr src/utils/ sizeof.h sizeof.c src/progs/ helena_main.adb src/obj/ --========== src/progs/helena_main.adb must be compiled and linked with sizeof.o I want to compile src/progs/helena_main.adb into executable helena and put it into src/../bin/ so here is the helena.gpr I made: --========== project Helena is for Object_Dir use "obj"; for Exec_Dir use "../bin"; for Source_Dirs use ("utils", "progs"); for Languages use ("Ada", "C"); for Main use ("helena_main.adb"); package Compiler is for Default_Switches ("Ada") use ("-O3", "-gnat05", "-gnata", "-gnatyM79", "-gnatwvrmkc"); for Default_Switches ("C") use ("-O3"); end Compiler; package Linker is for Default_Switches ("Ada") use ("obj/sizeof.o"); for Default_Switches ("C") use (); end Linker; package Builder is for Executable ("helena_main.adb") use "helena"; end Builder; end Helena; --========== when I launch the following command: > gnatmake -P helena.gpr the file sizeof.c in src/utils is not compiled. however, if I compile sizeof.c manually and put sizeof.o in src/obj the compilation works fine. I looked at http://www.adacore.com/wp-content/files/auto_update/gnat-unw-docs/html/gnat_ugn_12.html but i did not find help on how to do this. thanks for any help Sami