ocarina.gpr.in 4.8 KB
Newer Older
1
2
3
4
5
6
7
8
------------------------------------------------------------------------------
--                                                                          --
--                           OCARINA COMPONENTS                             --
--                                                                          --
--                              O C A R I N A                               --
--                                                                          --
--                              P r o j e c t                               --
--                                                                          --
jhugues's avatar
jhugues committed
9
--          Copyright (C) 2009-2012, European Space Agency (ESA).           --
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--                                                                          --
-- Ocarina  is free software;  you  can  redistribute  it and/or  modify    --
-- it under terms of the GNU General Public License as published by the     --
-- Free Software Foundation; either version 2, or (at your option) any      --
-- later version. Ocarina is distributed  in  the  hope  that it will be    --
-- useful, but WITHOUT ANY WARRANTY;  without even the implied warranty of  --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received  a copy of the --
-- GNU General Public License distributed with Ocarina; see file COPYING.   --
-- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth --
-- Floor, Boston, MA 02111-1301, USA.                                       --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable to be   --
-- covered  by the  GNU  General  Public  License. This exception does not  --
-- however invalidate  any other reasons why the executable file might be   --
-- covered by the GNU Public License.                                       --
--                                                                          --
--                 Ocarina is maintained by the Ocarina team                --
--                       (ocarina-users@listes.enst.fr)                     --
--                                                                          --
------------------------------------------------------------------------------

project Ocarina is
   Top_Src_Dir := External ("ABS_SRC_DIR", "../src");
   Top_Build_Dir := External ("ABS_BUILD_DIR", "../src");
   --  The absolute source dir and build dir are given through
   --  external variable from the command line because they need to be
   --  computed at runtime to be platform dependant.

   for Source_Dirs use ();

   type Build_Type is ("release", "debug");
   Build : Build_Type := External ("BUILD", "debug");

46
47
   type Lib_Kinds is ("relocatable", "static");
   Lib_Type : Lib_Kinds := External ("LIBRARY_TYPE", "static");
48
49
50
51
52
53
54

   package Compiler is
      for  Local_Configuration_Pragmas use Top_Src_Dir
         & "/../projects/restrictions.adc";
      case Build is
        when "debug" =>
           for Default_Switches ("Ada") use
55
             ("-fPIC",
56
57
58
59
60
61
              "-g",
              "-gnatfy",
              "-gnatwae",
              "-gnatoa",
              "-fstack-check",
              "-gnaty",
yoogx's avatar
yoogx committed
62
              "-gnatwl",
63
64
	      "-gnatyu", -- not in -gnaty: check multiple blank lines
	      "-gnatys", -- not in -gnatx: check useless parentheses
65
	      @GCOV@"-fprofile-arcs",
66
67
68
69
              @GCOV@"-ftest-coverage",
	      "-gnat05");
        when "release" =>
           for Default_Switches ("Ada") use
70
             ("-O2",
71
72
73
	      "-fPIC",
              "-gnat05",
              "-gnata",
74
75
76
              "-gnaty",
	      "-gnatyu", -- not in -gnaty: check multiple blank lines
	      "-gnatys", -- not in -gnatx: check useless parentheses
77
78
79
80
81
82
83
              "-gnatpn");
      end case;
   end Compiler;

   package Binder is
      case Build is
        when "debug" =>
yoogx's avatar
yoogx committed
84
           for Default_Switches ("Ada") use ("-E", "-t");
85
        when "release" =>
jhugues's avatar
jhugues committed
86
           for Default_Switches ("Ada") use ("-t", "-static");
87
88
89
90
91
92
93
      end case;
   end Binder;

   package Linker is
      case Build is
        when "debug" =>
        for Default_Switches ("Ada") use (
94
95
	    		     	     	  @GCOV@"-g",
					  @GCOV@"-fprofile-arcs",
96
97
98
99
100
101
102
103
104
105
					  @GCOV@"-ftest-coverage"
                                         );
        when "release" =>
           for Default_Switches ("Ada") use ();
      end case;
   end Linker;

   package Builder is
      case Build is
        when "debug" =>
106
           for Default_Switches ("Ada") use ("-g");
107
108
109
110
111
        when "release" =>
           for Default_Switches ("Ada") use ("-s");
      end case;
   end Builder;
end Ocarina;