-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathgprbuild.gpr
194 lines (154 loc) · 6.17 KB
/
gprbuild.gpr
1
2
3
4
5
6
7
8
9
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
------------------------------------------------------------------------------
-- --
-- GPR TECHNOLOGY --
-- --
-- Copyright (C) 2004-2023, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 GNAT; see file COPYING. If not, --
-- see <http://www.gnu.org/licenses/>. --
-- --
------------------------------------------------------------------------------
with "xmlada.gpr";
with "gpr/gpr.gpr";
project Gprbuild is
type Build_Type is ("debug", "production", "coverage", "profiling");
Bld : Build_Type := external ("GPRBUILD_BUILD",
external ("BUILD", "debug"));
type Target_type is ("Windows_NT", "UNIX");
Target : Target_Type := external ("OS", "UNIX");
type Install_Mode_Type is ("all", "gprbuildonly", "nointernal", "internal");
Install_Mode : Install_Mode_Type := external ("INSTALL_MODE", "all");
Processors := external ("PROCESSORS", "0");
for Languages use ("Ada");
Main_Bin :=
("gprconfig-main.adb",
"gprbuild-main.adb",
"gprclean-main.adb",
"gprinstall-main.adb",
"gprname-main.adb",
"gprls-main.adb");
Main_Libexec :=
("gprbind.adb",
"gprlib.adb");
case Install_Mode is
when "all" =>
for Main use Main_Bin & Main_Libexec;
when "gprbuildonly" =>
for Main use ("gprbuild-main.adb");
when "nointernal" =>
for Main use Main_Bin;
when "internal" =>
for Main use Main_Libexec;
end case;
for Source_Dirs use ("src");
for Object_Dir use "obj/" & Bld;
for Exec_Dir use "exe/" & Bld;
-------------
-- Builder --
-------------
package Builder is
for Executable ("gprconfig-main.adb") use "gprconfig";
for Executable ("gprbuild-main.adb") use "gprbuild";
for Executable ("gprclean-main.adb") use "gprclean";
for Executable ("gprinstall-main.adb") use "gprinstall";
for Executable ("gprls-main.adb") use "gprls";
for Executable ("gprname-main.adb") use "gprname";
for Default_Switches ("Ada") use ("-s", "-m", "-j" & Processors);
end Builder;
--------------
-- Compiler --
--------------
package Compiler is
Common_Switches := ("-gnat2020", "-gnaty", "-gnatQ", "-gnata", "-gnateE");
case Bld is
when "debug" =>
for Default_Switches ("Ada") use Common_Switches &
("-g", "-gnatVa", "-gnatwaCJI",
"-gnatwe", "-gnatyg");
for Local_Configuration_Pragmas use "debug.adc";
when "coverage" =>
for Default_Switches ("Ada") use Common_Switches &
("-ftest-coverage", "-fprofile-arcs");
when "profiling" =>
for Default_Switches ("Ada") use Common_Switches &
("-pg", "-g");
when "production" =>
for Default_Switches ("Ada") use Common_Switches &
("-O2", "-gnatn", "-gnatws");
-- Compile all GPRbuild sources to support symbolic-traceback
for Switches ("gpr*.ad?") use
Compiler'Default_Switches ("Ada") & ("-g1");
end case;
end Compiler;
------------
-- Binder --
------------
package Binder is
Common_Switches := ("-Es", "-static");
case Bld is
when "debug" =>
for Default_Switches ("Ada") use Common_Switches & ("-Sin");
when "coverage" | "profiling" | "production" =>
for Default_Switches ("Ada") use Common_Switches;
end case;
end Binder;
------------
-- Linker --
------------
package Linker is
case Bld is
when "production" =>
null;
when "debug" =>
for Default_Switches ("Ada") use ("-g");
when "coverage" =>
for Default_Switches ("Ada") use ("-lgcov");
when "profiling" =>
for Default_Switches ("Ada") use ("-pg", "-g");
end case;
end Linker;
-------------
-- Install --
-------------
package Install is
case Install_Mode is
when "all" | "nointernal" =>
for Artifacts ("share/doc/gprbuild/txt") use ("doc/txt/*.txt");
for Artifacts ("share/doc/gprbuild/info") use ("doc/info/*.info");
for Artifacts ("share/doc/gprbuild/pdf") use ("doc/pdf/*.pdf");
for Artifacts ("share/doc/gprbuild") use ("doc/html");
for Artifacts ("share") use ("share/gprconfig");
case Target is
when "Windows_NT" =>
for Artifacts ("bin") use ("src/gprinstall.exe.manifest");
when others =>
end case;
when "internal" =>
for Exec_Subdir use "libexec/gprbuild";
end case;
case Install_Mode is
when "all" | "gprbuildonly" | "nointernal" =>
for Artifacts ("share/examples/gprbuild") use ("examples/*");
for Artifacts ("share/gpr") use ("share/_default.gpr");
case Target is
when "UNIX" =>
for Artifacts (".") use ("doinstall");
when others =>
end case;
when others =>
end case;
end Install;
---------
-- IDE --
---------
package IDE is
for VCS_Kind use "Git";
end IDE;
end Gprbuild;