-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild_runtime.gpr
117 lines (101 loc) · 4.11 KB
/
build_runtime.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
-- Copyright (C) 2016-2024 Free Software Foundation, Inc.
-- This file is part of the FreeRTOS-Ada package.
--
-- The FreeRTOS-Ada package is free software; you can redistribute
-- it and/or modify it under the terms of the GNU General Public
-- License as published by the Free Software Foundation; either
-- version 3 of the License, or (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY 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
-- along with this program; see the file COPYING3. If not, see
-- <http://www.gnu.org/licenses/>.
with "../common/common";
with "../FreeRTOS";
library project Build_Runtime is
for Languages use ("Ada", "C", "ASM");
for Library_Auto_Init use "False";
for Library_Name use "gnat";
for Library_Kind use "static";
for Library_Dir use "adalib";
for Object_Dir use ".build";
for Source_Dirs use Common.Paths &
(
"adainclude",
FreeRTOS.Source,
FreeRTOS.Portable_Base & "ARM_CM4F"
);
for Target use external ("TARGET", "arm-eabi");
for Runtime ("ada") use Build_Runtime'Project_Dir;
type Build_Type is ("Production", "Debug");
Build : Build_Type := external ("CORTEX_GNAT_RTS_BUILD",
external ("BUILD", "Debug"));
type Callgraph_Type is ("yes", "no");
Callgraph : Callgraph_Type := external ("CALLGRAPH", "no");
package Compiler is
COMMON_FLAGS := ("-ffunction-sections", "-fdata-sections");
case Build is
when "Production" =>
COMMON_FLAGS := COMMON_FLAGS & ("-g", "-O2");
when "Debug" =>
COMMON_FLAGS := COMMON_FLAGS & ("-g", "-Og");
-- -O0 is costly, e.g. in the Timer_Events task.
end case;
case Callgraph is
when "yes" =>
COMMON_FLAGS := COMMON_FLAGS & ("-fcallgraph-info=su,da");
when "no" =>
null;
end case;
ALL_ADAFLAGS :=
("-gnatwae", "-gnatpgn", "-gnatqQ", "-nostdinc")
& COMMON_FLAGS
& external_as_list ("EXTRA_ADAFLAGS", " ");
case Build is
when "Production" =>
null;
when "Debug" =>
ALL_ADAFLAGS := ALL_ADAFLAGS & "-gnata";
end case;
ALL_CFLAGS :=
external_as_list("INCLUDES", " ")
& external_as_list("DEFINES", " ")
& "-I" & FreeRTOS.Include
& ("-DIN_RTS", "-Dinhibit_libc")
& COMMON_FLAGS;
NO_SIBLING_ADAFLAGS := ("-fno-optimize-sibling-calls");
NO_REORDER_ADAFLAGS := ("-fno-toplevel-reorder");
for Switches ("C") use ALL_CFLAGS;
for Switches ("Ada") use ALL_ADAFLAGS;
for Switches ("startup.adb") use ALL_ADAFLAGS & ("-Wno-attributes");
for Switches ("s-traceb.adb") use ALL_ADAFLAGS & ("-g")
& NO_SIBLING_ADAFLAGS & ("-fno-inline-functions-called-once");
for Switches ("s-tasdeb.adb") use ALL_ADAFLAGS & ("-g", "-O0");
for Switches ("a-except.adb") use ALL_ADAFLAGS
& ("-g", "-O1", "-fno-inline") & NO_REORDER_ADAFLAGS;
for Switches ("s-excdeb.adb") use ALL_ADAFLAGS & ("-g", "-O0");
for Switches ("s-assert.adb") use ALL_ADAFLAGS & ("-g");
for Switches ("a-tags.adb") use ALL_ADAFLAGS & ("-g");
for Switches ("last_chance_handler.c") use ALL_CFLAGS & ("-g", "-O0");
for Switches ("s-harhan.adb") use ALL_ADAFLAGS & ("-g", "-O0");
end Compiler;
package Install is
case Common.Local is
when "no" =>
for Prefix use "arm-eabi/lib/gnat/";
when "yes" =>
for Prefix use project'Project_Dir & "../local/";
end case;
for Prefix use Install'Prefix & "stm32f429i";
for Sources_Subdir use "adainclude";
for Ali_Subdir use "adalib";
for Lib_Subdir use "adalib";
for Required_Artifacts (".") use ("runtime.xml");
for Required_Artifacts ("ld") use ("ld/stm32f429i-flash.ld");
for Install_Project use "false";
end Install;
end Build_Runtime;