Added debug project which builds a static library with debug symbols. Regular project build shared object with optimisations. Test links to debug library. Putting library ALIs in ali directory.

This commit is contained in:
Anthony Arnold 2012-01-17 12:36:30 +10:00
parent 96b9a94f20
commit 874b239271
8 changed files with 40 additions and 8 deletions

View File

@ -5,13 +5,14 @@ library project AdaID is
for Source_Dirs use ("src");
for Library_Dir use "lib";
for Library_Kind use "dynamic";
for Library_ALI_Dir use "ali";
for Library_Version use "libadaid.so." & Version;
package Builder is
for Default_Switches("Ada") use ("-g", "-gnat12", "-gnatQ");
for Default_Switches("Ada") use ("-O2", "-gnat12", "-gnatQ");
end Builder;
package Compiler is
for Default_Switches("Ada") use ("-g", "-gnat12", "-I./include");
for Default_Switches("Ada") use ("-O2", "-gnat12", "-I./include");
end Compiler;
end AdaID;

16
adaid_debug.gpr Normal file
View File

@ -0,0 +1,16 @@
library project AdaID_Debug is
for Library_Name use "adaid_debug";
for Object_Dir use "obj/debug";
for Source_Dirs use ("src");
for Library_Dir use "lib";
for Library_Kind use "static";
for Library_ALI_Dir use "ali/debug";
package Builder is
for Default_Switches("Ada") use ("-g", "-gnat12", "-gnatQ");
end Builder;
package Compiler is
for Default_Switches("Ada") use ("-g", "-gnat12", "-I./include");
end Compiler;
end AdaID_Debug;

2
ali/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.ali
*.o

2
ali/debug/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.ali
*.o

View File

@ -1,10 +1,18 @@
LIB=./lib/libadaid.so
DEBUG=./lib/libadaid.a
TEST=./bin/test
#library
$(LIB): src/*.adb src/*.ads include/*.ads
gnatmake -Padaid.gpr
#debugging
.PHONY: debug
debug: $(DEBUG)
$(DEBUG): src/*.adb src/*.ads include/*.ads
gnatmake -Padaid_debug.gpr
#test executable
$(TEST): $(LIB) include/*.ads test/*.adb test/*.ads
@ -12,7 +20,6 @@ $(TEST): $(LIB) include/*.ads test/*.adb test/*.ads
#run tests
test: $(TEST)
@export LD_LIBRARY_PATH=./lib;\
$(TEST)
#misc
@ -23,7 +30,7 @@ all: $(LIB) $(TEST)
.PHONY: clean
.PHONY: cleanall
clean:
rm -f obj/* 2> /dev/null
rm -f obj/*.* obj/test/*.* obj/debug/*.* ali/*.* ali/debug/*.* 2> /dev/null
cleanall: clean
rm -f bin/* lib/* 2> /dev/null

2
obj/debug/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.ali
*.o

2
obj/test/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.ali
*.o

View File

@ -1,8 +1,8 @@
with "aunit.gpr";
with "adaid.gpr";
with "adaid_debug.gpr";
project Test is
for Languages use ("Ada");
for Object_Dir use "obj";
for Object_Dir use "obj/test";
for Source_Dirs use ("test");
for Main use ("test.adb");
for Exec_Dir use "bin";
@ -17,7 +17,7 @@ project Test is
end Linker;
package Compiler is
for Default_Switches("Ada") use ("-Llib", "-ladaid", "-gnatf", "-g", "-I./include");
for Default_Switches("Ada") use ("-Llib", "-ladaid_debug", "-gnatf", "-g", "-I./include");
end Compiler;
package Binder is