Fix build procedure.
[morzhol.git] / morzhol.gpr
bloba551808702b20aa3174f18323d2de5651d2c47bf
1 ------------------------------------------------------------------------------
2 --                                Morzhol                                   --
3 --                                                                          --
4 --                         Copyright (C) 2007-2009                          --
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
47                    & ("-fprofile-arcs");
48             when "Release" =>
49                for Object_Dir use ".build/release/obj";
50                for Library_Dir use ".build/release/lib";
51          end case;
52       when "Static" =>
53          for Object_Dir use ".build/static/obj";
54          for Library_Dir use ".build/static/lib";
55    end case;
57    -------------
58    -- Builder --
59    -------------
61    package Builder is
62       for Default_Switches ("Ada") use ("-m");
63    end Builder;
65    --------------
66    -- Compiler --
67    --------------
69    Common_Options  :=
70      ("-gnat05", "-gnatwcfijkmruv", "-gnaty3abcefhiklmnoprstx", "-Wall");
71    --  Common options used for the Debug and Release modes
73    Debug_Options   :=
74      ("-g", "-gnata", "-gnatVa", "-gnatQ", "-gnato", "-gnatwe");
76    Release_Options :=
77      ("-O2", "-gnatn");
79    ----------------
80    --  Compiler  --
81    ----------------
83    package Compiler is
84       case Build is
85          when "Debug" | "Profile" =>
86             for Default_Switches ("Ada") use Common_Options & Debug_Options;
88          when "Release" =>
89             for Default_Switches ("Ada") use Common_Options & Release_Options;
90       end case;
91    end Compiler;
93    ---------
94    -- Ide --
95    ---------
97    package Ide is
98       for VCS_Kind use "Git";
99    end Ide;
101    ------------
102    -- Binder --
103    ------------
105    package Binder is
106       case Build is
107          when "Debug" | "Profile" =>
108             for Default_Switches ("Ada") use ("-E", "-g");
110          when "Release" =>
111             for Default_Switches ("Ada") use ("-E");
112       end case;
113    end Binder;
115 end Morzhol;