-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlibkernel.gpr
224 lines (199 loc) · 8.15 KB
/
libkernel.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
library project Libkernel is
type Build_Size_Type is ("size", "hybrid", "perf");
Build_Size : Build_Size_Type := external("KERNEL_ADA_BUILDSIZE");
type Mode_Type is ("debug", "release");
Mode : Mode_Type := external ("MODE");
basic :=
("-fstack-usage", -- Generate .su file with informations about the
-- amount of stack used
"-gnateG", -- Generate preprocessed source
"-gnatep=" & Libkernel'Project_Dir & "gnatprep.def", -- Preprocessing data file
"-gnatet=target.atp",
"-gnatec=" & Libkernel'Project_Dir & "libkernel.adc",
"-gnatn", -- Enable pragma Inline
"-gnatwa", -- Turn on all warnings
"-gnatw.X", -- Turn off warnings for export/import
"-gnatwe"); -- Treat all warnings as errors
debug :=
("-g",
"-gnata"); -- Enable pragma Assert | Debug
verif :=
("-gnato"); -- Turn on all checks
-- ("-gnato", -- Turn on all checks
-- "-gnatVa"); -- Turn on all validity checks
no_verif :=
("-gnatp", -- Turn off all checks
"-gnatVn"); -- Turn off all validity checks
-- TODO: the arch and ABI should not be hard-coded here. Yet we should
-- specify the float ABI to Gnat
arch :=
("-mcpu=cortex-m4",
"-mfloat-abi=soft");
size_switches := ();
perf_switches := ();
case Build_Size is
when "size" =>
size_switches := ("-Os") & basic;
perf_switches := ("-Os") & basic;
when "hybrid" =>
size_switches := ("-Os") & basic;
perf_switches := ("-O2") & basic;
when "perf" =>
size_switches := ("-O2") & basic;
perf_switches := ("-O2") & basic;
end case;
for Languages use ("Ada");
for Source_Dirs use
("src",
"src/arch/Ada",
"src/arch/cores/" & external("ARCH"),
"src/arch/socs/" & external("SOCNAME"),
"src/arch/socs/" & external("SOCNAME") & "/generated",
"src/syscalls",
"src/exported",
"src/generated");
for Library_Dir use external("BUILD_DIR") & "/Ada/lib";
for Object_Dir use external("BUILD_DIR") & "/Ada";
for Target use external("ADA_ARCH");
for Runtime ("ada") use external("ADA_PROFILE");
for Library_Name use "kernel";
for Library_Kind use "static";
for Library_Interface use
("config",
"config.applications",
"config.memlayout",
"config.tasks",
"main",
"ewok",
"ewok.alarm",
"ewok.debug",
"ewok.devices",
"ewok.devices.perms",
"ewok.devices_shared",
"ewok.dma",
"ewok.dma_shared",
"ewok.exported",
"ewok.exported.devices",
"ewok.exported.dma",
"ewok.exported.gpios",
"ewok.exported.interrupts",
"ewok.exported.sleep",
"ewok.exti",
"ewok.exti.handler",
"ewok.gpio",
"ewok.interrupts",
"ewok.interrupts.handler",
"ewok.ipc",
"ewok.isr",
"ewok.layout",
"ewok.memory",
"ewok.mpu",
"ewok.mpu.allocator",
"ewok.mpu.handler",
"ewok.perm",
"ewok.perm_auto",
"ewok.rng",
"ewok.sanitize",
"ewok.sched",
"ewok.softirq",
"ewok.syscalls",
"ewok.syscalls.alarm",
"ewok.syscalls.cfg",
"ewok.syscalls.cfg.dev",
"ewok.syscalls.cfg.gpio",
"ewok.syscalls.dma",
"ewok.syscalls.gettick",
"ewok.syscalls.handler",
"ewok.syscalls.init",
"ewok.syscalls.ipc",
"ewok.syscalls.log",
"ewok.syscalls.sleep",
"ewok.syscalls.yield",
"ewok.syscalls.exiting",
"ewok.tasks",
"ewok.tasks.debug",
"ewok.tasks_shared",
"ewok.sleep",
"ewok.posthook",
"soc.devmap",
"soc.dma",
"soc.dma.interfaces",
"soc.dwt",
"soc.exti",
"soc.gpio",
"soc.gpio.interfaces",
"soc.interrupts",
"soc.layout",
"soc.layout.stm32f42x",
"soc.layout.stm32f4",
"soc.nvic",
"soc.rcc",
"soc.rng",
"soc.syscfg",
"soc.usart",
"soc.usart.interfaces",
"soc",
"m4.cpu",
"m4.cpu.instructions",
"m4.layout",
"m4.mpu",
"m4.scb",
"m4.systick",
"m4",
"types",
"types.c",
"processor",
"rings");
Local_Path := ".";
package Compiler is
case Mode is
when "debug" =>
for Default_Switches ("ada") use size_switches & arch & debug & verif;
for Switches ("ewok-sched.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-tasks.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-memory.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-interrupts-handler.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-syscalls-handler.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-syscalls-ipc.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-isr.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-posthook.adb") use perf_switches & debug & arch & verif;
for Switches ("ewok-softirq.adb") use perf_switches & debug & arch & verif;
for Switches ("soc-dma.adb") use perf_switches & debug & arch & verif;
for Switches ("soc-gpio.adb") use perf_switches & debug & arch & verif;
for Switches ("soc-gpio-interfaces.adb") use perf_switches & debug & arch & verif;
when "release" =>
for Default_Switches ("ada") use size_switches & arch & verif;
for Switches ("ewok-sched.adb") use perf_switches & verif & arch;
for Switches ("ewok-tasks.adb") use perf_switches & verif & arch;
for Switches ("ewok-interrupts-handler.adb") use perf_switches & verif & arch;
for Switches ("ewok-syscalls-handler.adb") use perf_switches & verif & arch;
for Switches ("ewok-syscalls-ipc.adb") use perf_switches & verif & arch;
for Switches ("ewok-isr.adb") use perf_switches & verif & arch;
for Switches ("ewok-posthook.adb") use perf_switches & verif & arch;
for Switches ("ewok-softirq.adb") use perf_switches & verif & arch;
for Switches ("soc-dma.adb") use perf_switches & verif & arch;
for Switches ("soc-gpio.adb") use perf_switches & verif & arch;
for Switches ("soc-gpio-interfaces.adb") use perf_switches & verif & arch;
end case;
for Switches ("soc-interrupts.adb") use perf_switches & arch & verif;
-- Proved SPARK code
for Switches ("m4-scb.adb") use perf_switches & arch & no_verif;
for Switches ("m4-systick.adb") use perf_switches & arch & no_verif;
for Switches ("m4-mpu.adb") use perf_switches & arch & no_verif;
for Switches ("soc-nvic.adb") use perf_switches & arch & no_verif;
for Switches ("soc-interrupts.adb") use perf_switches & arch & no_verif;
for Switches ("soc-dwt.adb") use perf_switches & arch & no_verif;
for Switches ("soc-syscfg.adb") use perf_switches & arch & no_verif;
for Switches ("processor.adb") use perf_switches & arch & no_verif;
for Switches ("ewok-perm.adb") use perf_switches & arch & no_verif;
for Switches ("ewok-mpu.adb") use perf_switches & arch & no_verif;
for Switches ("rings.adb") use perf_switches & arch & no_verif;
-- Debugging / error handling code
for Switches ("ewok-tasks-debug.adb") use size_switches & arch & no_verif;
for Switches ("ewok-debug.adb") use size_switches & arch & no_verif;
for Switches ("ewok-mpu-handler.adb") use size_switches & arch & no_verif;
end Compiler;
package Binder is
for Default_Switches ("ada") use ("-n");
end Binder;
end Libkernel;