-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlea.gpr
170 lines (152 loc) · 7.11 KB
/
lea.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
-- This is a GNAT, GCC or GNAT Studio project file
-- for the LEA project:
--
-- home page: http://l-e-a.sf.net/
-- project page: http://sf.net/projects/l-e-a/
-- mirror: https://github.com/zertovitch/lea
--
-- Build me with "gprbuild -P lea", or open me with GNAT Studio
--
-- This variant is a single project, which handles all sources.
-- See "lea_project_tree.gpr" for the other variant.
--
-- *** External libraries (of which all sources are grabbed by this project file) ***
-- *
-- * You need to make the following projects' source files visible to this project
-- * through the ad-hoc (not GNAT / AdaCore official) GNAT_SOURCE_PATH environment variable:
-- *
-- * * GWindows and contributions:
-- * [gnavi]\gwindows\framework
-- * [gnavi]\gwindows\contrib
-- * [gnavi]\gnatcom\framework
-- * Project URL: http://sf.net/projects/gnavi/
-- * Mirror URL: https://github.com/zertovitch/gwindows
-- * NB: The Unicode (default) mode of GWindows is needed; in doubt, run [gnavi]\gwindows\unicode.cmd
-- *
-- * * HAC Ada Compiler:
-- * Project URL: https://sourceforge.net/projects/hacadacompiler/
-- * Mirror URL: https://github.com/zertovitch/hac
-- *
-- * * Ini file manager:
-- * [ini]
-- * Project URL: http://ini-files.sourceforge.net/
-- * Mirror URL: https://github.com/zertovitch/ini-files
--
-- * * Zip-Ada:
-- * [zip-ada]\zip_lib
-- * Project URL: http://unzip-ada.sf.net
-- * Mirror URL: https://github.com/zertovitch/zip-ada
-- *
-- * Example: GNAT_SOURCE_PATH=
-- * ======= C:\Ada\gnavi\gwindows\framework;C:\Ada\gnavi\gwindows\contrib;C:\Ada\gnavi\gnatcom\framework;
-- * C:\Ada\hac\src;C:\Ada\hac\src\compile;C:\Ada\hac\src\compile\emit;C:\Ada\hac\src\execute;C:\Ada\hac\src\manage;
-- * C:\Ada\ini;
-- * C:\Ada\zip-ada\zip_lib;
project LEA is
type LEA_Build_Mode_Type is
("Debug",
"Debug_MinGW",
"Fast",
"Fast_MinGW",
"Small",
"Small_MinGW",
"Small_Unchecked", -- Smallest size, at the price of less safety. Not for the release binary!
"Profiling");
LEA_Build_Mode : LEA_Build_Mode_Type := external ("LEA_Build_Mode", "Debug");
for Main use ("lea_without_data.adb", "sample_catalogue.adb");
for Source_Dirs use (".") & external_as_list("GNAT_SOURCE_PATH", ";");
for Exec_Dir use ".";
for Create_Missing_Dirs use "True"; -- Flips by default the "-p" switch
case LEA_Build_Mode is
when "Debug" => for Object_Dir use "obj/debug";
when "Fast" => for Object_Dir use "obj/fast";
when "Small" => for Object_Dir use "obj/small";
when "Debug_MinGW" => for Object_Dir use "obj/debug_ming";
when "Fast_MinGW" => for Object_Dir use "obj/fast_ming";
when "Small_MinGW" => for Object_Dir use "obj/small_ming";
when "Small_Unchecked" => for Object_Dir use "obj/small_unchecked";
when "Profiling" => for Object_Dir use "obj/profiling";
end case;
Compiler_Common_Options :=
("-gnatwa", -- Warnings switches (a:turn on all info/warnings marked with +)
-- "-gnatwh", -- Warnings switches (h:turn on warnings for hiding declarations)
"-gnatwcijkmopruvz.c.p.t.w.x", -- Warnings switches (run "gnatmake" for full list)
"-gnatf", -- Full errors. Verbose details, all undefined references
"-gnatq", -- Don't quit, try semantics, even if parse errors
"-gnatQ", -- Don't quit, write ali/tree file even if compile errors
"-g", -- Generate debugging information
--
"-gnatyaknpr", -- Style: check all casings: a:attribute, k:keywords, n:package Standard identifiers, p:pragma, r:identifier references
"-gnatybfhiu", -- Style: check b:no blanks at end of lines, f:no ff/vtabs, h: no htabs, i:if-then layout, u:no unnecessary blank lines
"-gnatyx", -- Style: check x:no extra parens
"-gnatye", -- Style: check e:end/exit labels present
"-gnatyc", -- Style: check c:comment format (two spaces)
"-gnatyt"); -- Style: check t:token separation rules
Compiler_Debug_Options :=
("-gnata", -- Assertions enabled
"-gnato", -- Enable overflow checking in STRICT mode
"-gnatVa", -- Enable all validity checking options
"-fstack-check",
"-fno-inline") &
Compiler_Common_Options;
Compiler_Fast_Options :=
("-O3",
"-gnatpn",
"-g") &
Compiler_Common_Options;
Compiler_Profiling_Options :=
("-O2",
"-gnatp",
"-fno-inline",
"-pg") &
Compiler_Common_Options;
Compiler_Small_Options :=
("-Os",
-- "-fdata-sections",
"-ffunction-sections") &
Compiler_Common_Options;
package Compiler is
case LEA_Build_Mode is
when "Debug" | "Debug_MinGW" =>
for Default_Switches ("ada") use Compiler_Debug_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "debug.pra";
when "Fast" | "Fast_MinGW" =>
for Default_Switches ("ada") use Compiler_Fast_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
when "Small" | "Small_MinGW" =>
for Default_Switches ("ada") use Compiler_Small_Options;
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
when "Small_Unchecked" =>
for Default_Switches ("ada") use Compiler_Small_Options & ("-gnatp");
for Local_Configuration_Pragmas use project'Project_Dir & "lea_elim.pra";
when "Profiling" =>
for Default_Switches ("ada") use Compiler_Profiling_Options;
end case;
end Compiler;
package Binder is
-- -Es: Store tracebacks in exception occurrences, and enable symbolic tracebacks
for Default_Switches ("ada") use ("-Es");
end Binder;
Linker_Common_Options := ("-g", "lea.rbj", "-Xlinker", "--stack=0x2000000,0x20000");
Linker_Small_Options :=
Linker_Common_Options & ("-Wl,--gc-sections");
package Linker is
case LEA_Build_Mode is
when "Debug" | "Debug_MinGW" =>
for Default_Switches ("ada") use Linker_Common_Options;
when "Fast" | "Fast_MinGW" |
"Small" | "Small_MinGW" | "Small_Unchecked"=>
for Default_Switches ("ada") use Linker_Small_Options & ("-mwindows", "-s");
when "Profiling" =>
for Default_Switches ("ada") use Linker_Small_Options & ("-pg");
end case;
end Linker;
package Builder is
-- "If -j0 is used, then the maximum number of simultaneous compilation
-- jobs is the number of core processors on the platform."
for Default_Switches ("ada") use ("-j0");
end Builder;
package Ide is
for Default_Switches ("adacontrol") use ("-f", "verif.aru");
end Ide;
end LEA;