comp.lang.ada
 help / color / mirror / Atom feed
From: "evangeli@cnam.fr" <evangeli@cnam.fr>
Subject: compiling C files with gnat project files
Date: 13 Nov 2006 05:47:40 -0800
Date: 2006-11-13T05:47:40-08:00	[thread overview]
Message-ID: <1163425660.255360.210170@h48g2000cwc.googlegroups.com> (raw)

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




             reply	other threads:[~2006-11-13 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-13 13:47 evangeli [this message]
2006-11-13 14:16 ` compiling C files with gnat project files Ludovic Brenta
2006-11-13 14:23   ` evangeli
2006-11-13 14:26   ` Alex R. Mosteo
2006-11-13 20:24     ` sphinxmoro
replies disabled

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