-
Notifications
You must be signed in to change notification settings - Fork 0
/
labs_solar_system.gpr
134 lines (118 loc) · 4 KB
/
labs_solar_system.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
with "config/labs_solar_system_config.gpr";
with "mage.gpr";
project Labs_Solar_System is
type Lab_T is
("Getting_Started",
"Array_Types",
"Record_Types",
"Subprograms",
"Packages",
"Private_Types",
"Access_Types",
"Genericity",
"Multiple_Inheritance",
"Exceptions",
"Interfacing_With_C",
"Tasking_Protected_Objects",
"Subprogram_Contracts");
Lab : Lab_T := external ("Lab", "Getting_Started");
type Mode_Type is ("Question", "Answer");
Mode : Mode_Type := external ("Mode", "Question");
type Backend_T is ("Mage", "TSV");
Backend : Backend_T := external("Backend", "Mage");
Answer_Mode_Dir := "";
case Mode is
when "Question" =>
Answer_Mode_Dir := "src";
when "Answer" =>
Answer_Mode_Dir := "answers";
end case;
Lab_Number := "";
Lab_Name := "";
Lab_Languages := ("Ada");
Lab_Source_Dir := ();
Lab_Switches_Ada := ();
case Lab is
when "Getting_Started" =>
Lab_Number := "000";
Lab_Name := "getting_started";
Answer_Mode_Dir := "src"; -- no separate "answer" dir
when "Array_Types" =>
Lab_Number := "050";
Lab_Name := "array_types";
when "Record_Types" =>
Lab_Number := "060";
Lab_Name := "record_types";
when "Subprograms" =>
Lab_Number := "070";
Lab_Name := "subprograms";
when "Packages" =>
Lab_Number := "100";
Lab_Name := "packages";
when "Private_Types" =>
Lab_Number := "110";
Lab_Name := "private_types";
when "Access_Types" =>
Lab_Number := "140";
Lab_Name := "access_types";
Lab_Source_Dir := ("src/" & Lab_Number & "_" & Lab_Name & "/common");
when "Genericity" =>
Lab_Number := "160";
Lab_Name := "genericity";
Lab_Source_Dir := ("src/" & Lab_Number & "_" & Lab_Name & "/common");
when "Multiple_Inheritance" =>
Lab_Number := "adv_170";
Lab_Name := "multiple_inheritance";
Lab_Switches_Ada := ("-gnatw_A");
when "Exceptions" =>
Lab_Number := "190";
Lab_Name := "exceptions";
Lab_Source_Dir := ("src/" & Lab_Number & "_" & Lab_Name & "/common");
when "Interfacing_With_C" =>
Lab_Number := "230";
Lab_Name := "interfacing_with_c";
Lab_Languages := Lab_Languages & "C";
Lab_Source_Dir := ("src/" & Lab_Number & "_" & Lab_Name & "/" & Answer_Mode_Dir & "/compute_c");
when "Tasking_Protected_Objects" =>
Lab_Number := "adv_240";
Lab_Name := "tasking_protected_objects";
when "Subprogram_Contracts" =>
Lab_Number := "adv_270";
Lab_Name := "subprogram_contracts";
Lab_Source_Dir := ("src/" & Lab_Number & "_" & Lab_Name & "/common");
end case;
Lab_Source_Dir := Lab_Source_Dir & ("src/" & Lab_Number & "_" & Lab_Name & "/" & Answer_Mode_Dir);
for Languages use Lab_Languages;
for Source_Dirs use ("config/", "src/common/") & Lab_Source_Dir;
for Object_Dir use "obj/" & Labs_Solar_System_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin";
for Main use (Lab_Name & "_main");
package Naming is
case Backend is
when "Mage" =>
for Spec ("Draw.Config") use "draw-config.use-mage.ads";
when "TSV" =>
for Spec ("Draw.Config") use "draw-config.use-tsv.ads";
end case;
end Naming;
package Builder is
for Default_Switches ("Ada") use (
"-m2" -- Use file content to check re-compilation
);
end Builder;
package Compiler is
for Default_Switches ("Ada") use Labs_Solar_System_Config.Ada_Compiler_Switches
& ("-Og", "-g", "-gnata") & Lab_Switches_Ada;
for Default_Switches ("C") use ("-Wall", "-pedantic", "-Werror");
end Compiler;
package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;
package Linker is
for Switches ("Ada") use Mage.Linker_Ada_Switches;
end Linker;
package Install is
for Artifacts (".") use ("share");
end Install;
end Labs_Solar_System;