aboutsummaryrefslogtreecommitdiff
path: root/sokoban.gpr
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-04-15 23:21:04 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2025-04-15 23:21:04 +1200
commite62c2e2403d072640f0400c499f1dfd99e938c16 (patch)
tree761716800f87af456c8b626fd63640c068a1e0d5 /sokoban.gpr
parent5680d81f2740ff2f6d9440a885cb76df6cd830f4 (diff)
More detailed project file, installs shared data correctly
Diffstat (limited to 'sokoban.gpr')
-rw-r--r--sokoban.gpr100
1 files changed, 95 insertions, 5 deletions
diff --git a/sokoban.gpr b/sokoban.gpr
index 8c87a18..49ade69 100644
--- a/sokoban.gpr
+++ b/sokoban.gpr
@@ -1,6 +1,8 @@
-with "fltkada";
+with
+
+ "fltkada";
project Sokoban is
@@ -9,27 +11,115 @@ project Sokoban is
for Languages use ("Ada");
- for Source_Dirs use ("src/**");
+ for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "bin";
for Main use ("main.adb");
+ type Build_Kind is ("release", "debug");
+
+ Ver : Build_Kind := external ("build", "release");
+
+
package Builder is
- for Executable("main.adb") use "sokoban";
+ for Default_Switches ("Ada") use ("-j4", "-m");
+
+ case Ver is
+
+ when "release" =>
+ null;
+
+ when "debug" =>
+ for Default_Switches ("Ada") use Builder'Default_Switches ("Ada") & "-g";
+
+ end case;
+
+ for Executable ("main.adb") use "sokoban";
end Builder;
+ Ada_Common :=
+ ("-gnaty"
+ & "4" -- indentation
+ & "a" -- attribute casing
+ & "A" -- array attribute indices
+ & "b" -- blanks at end of lines
+ & "c" -- two space comments
+ & "e" -- end/exit labels
+ & "f" -- no form feeds or vertical tabs
+ & "h" -- no horizontal tabs
+ & "i" -- if/then layout
+ & "k" -- keyword casing
+ & "l" -- reference manual layout
+ & "M100" -- max line length
+ & "n" -- package Standard casing
+ & "p" -- pragma casing
+ & "r" -- identifier casing
+ & "t", -- token separation
+ "-gnatw"
+ & "a" -- various warning modes
+ & "F" -- don't check for unreferenced formal parameters
+ & "J" -- don't check for obsolescent feature use
+ & "U"); -- don't check for unused entities
+
+ C_Common :=
+ ("-Wall",
+ "-Werror",
+ "-Wextra",
+ "-Wpedantic");
+
package Compiler is
- for Default_Switches("Ada") use ("-gnaty4aAbcefhiklM99nprt");
+ case Ver is
+
+ when "release" =>
+ for Default_Switches ("Ada") use Ada_Common & "-O3" & "-gnatn";
+ for Default_Switches ("C") use C_Common & "-O3";
+
+ when "debug" =>
+ for Default_Switches ("Ada") use Ada_Common & "-O0" & "-gnata" & "-gnato" & "-g";
+ for Default_Switches ("C") use C_Common & "-O0";
+
+ end case;
end Compiler;
+ package Binder is
+ case Ver is
+
+ when "release" =>
+ null;
+
+ when "debug" =>
+ for Default_Switches ("Ada") use Binder'Default_Switches ("Ada") & "-Es";
+
+ end case;
+ end Binder;
+
+
package Linker is
- for Default_Switches("Ada") use ("-lfltk", "-lfltk_images");
+ case Ver is
+
+ when "release" =>
+ null;
+
+ when "debug" =>
+ for Default_Switches ("Ada") use ("-g");
+
+ end case;
+
+ for Default_Switches ("Ada") use
+ Linker'Default_Switches ("Ada") & ("-lfltk", "-lfltk_images");
end Linker;
+ package Install is
+ for Artifacts ("share") use ("share/*");
+ for Required_Artifacts ("share") use ("share/sokoban/img/*", "share/sokoban/level/*");
+ for Mode use "usage";
+ end Install;
+
+
end Sokoban;