Improve implementation to handle sub-path.
[morzhol.git] / morzhol.gpr
blobf9acf6449a439636f418c7a8b18e82a7b74b33ca
1 ------------------------------------------------------------------------------
2 --                                Morzhol                                   --
3 --                                                                          --
4 --                           Copyright (C) 2007                             --
5 --                      Pascal Obry - Olivier Ramonat                       --
6 --                                                                          --
7 --  This library is free software; you can redistribute it and/or modify    --
8 --  it under the terms of the GNU General Public License as published by    --
9 --  the Free Software Foundation; either version 2 of the License, or (at   --
10 --  your option) any later version.                                         --
11 --                                                                          --
12 --  This library is distributed in the hope that it will be useful, but     --
13 --  WITHOUT ANY WARRANTY; without even the implied warranty of              --
14 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       --
15 --  General Public License for more details.                                --
16 --                                                                          --
17 --  You should have received a copy of the GNU General Public License       --
18 --  along with this library; if not, write to the Free Software Foundation, --
19 --  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.       --
20 ------------------------------------------------------------------------------
22 project Morzhol is
24    type OS_Type is ("UNIX", "Windows_NT");
25    OS : OS_Type := external ("OS", "UNIX");
27    type Build_Type is ("Debug", "Release", "Profile");
28    Build : Build_Type := external ("PRJ_BUILD", "Debug");
30    type Lib_Type is ("Dynamic", "Static");
31    LT : Lib_Type := external ("LIB_TYPE", "Dynamic");
33    for Source_Dirs use ("src");
34    for Library_Name use "morzhol";
35    for Library_Kind use LT;
37    case LT is
38       when "Dynamic" =>
39          case Build is
40             when "Debug" =>
41                for Object_Dir use ".build/debug/obj";
42                for Library_Dir use ".build/debug/lib";
43             when "Profile" =>
44                for Object_Dir use ".build/profile/obj";
45                for Library_Dir use ".build/profile/lib";
46                for Library_Options use Project'Library_Options & ("-fprofile-arcs");
47             when "Release" =>
48                for Object_Dir use ".build/release/obj";
49                for Library_Dir use ".build/release/lib";
50          end case;
51       when "Static" =>
52          for Object_Dir use ".build/static/obj";
53          for Library_Dir use ".build/static/lib";
54    end case;
56    -------------
57    -- Builder --
58    -------------
60    package Builder is
61       for Default_Switches ("Ada") use ("-m");
62    end Builder;
64    --------------
65    -- Compiler --
66    --------------
68    Common_Options  :=
69      ("-gnat05", "-gnatwcfijkmruv", "-gnaty3abcefhiklmnoprstx", "-Wall");
70    --  Common options used for the Debug and Release modes
72    Debug_Options   :=
73      ("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-gnatwe");
75    Release_Options :=
76      ("-O2", "-gnatn");
78    ----------------
79    --  Compiler  --
80    ----------------
82    package Compiler is
83       case Build is
84          when "Debug" | "Profile" =>
85             for Default_Switches ("Ada") use Common_Options & Debug_Options;
87          when "Release" =>
88             for Default_Switches ("Ada") use Common_Options & Release_Options;
89       end case;
90    end Compiler;
92    ---------
93    -- Ide --
94    ---------
96    package Ide is
97       for Vcs_Kind use "SVN";
98    end Ide;
100    ------------
101    -- Binder --
102    ------------
104    package Binder is
105       case Build is
106          when "Debug" | "Profile" =>
107             for Default_Switches ("Ada") use ("-E", "-g");
109          when "Release" =>
110             for Default_Switches ("Ada") use ("-E");
111       end case;
112    end Binder;
114    ------------
115    -- Linker --
116    ------------
118    package Linker is
119       case Build is
120          when "Debug" | "Profile" =>
121             for Default_Switches ("Ada") use ("-g");
123          when "Release" =>
124             for Default_Switches ("Ada") use ();
125       end case;
126    end Linker;
128 end Morzhol;