forked from ada-game-framework/sdlada
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
64 lines (45 loc) · 1.8 KB
/
makefile
File metadata and controls
64 lines (45 loc) · 1.8 KB
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
ifeq ($(GNATMAKE),)
GPRMAKE = gprbuild
endif
ifeq ($(GNATCLEAN),)
GPRCLEAN = gprclean
endif
ifeq ($(D),1)
DEBUG = -gnatd.n
endif
SRCS = src/sdl.ads
ifeq ($(STATIC),)
STATIC = yes
endif
ifeq ($(STATIC),yes)
SDL2_LIBS = `sdl2-config --libs`
else
SDL2_LIBS = `sdl2-config --static-libs`
endif
all: sdl_build.gpr test_maths_build.gpr test.gpr
# TODO: Fix the compiler so we actually get shared libs!
#
#####################################################################################
# SDL library
sdl_build.gpr: lib/libadasdl.a
$(GPRMAKE) $(DEBUG) -p -gnat2012 -XSDL_PLATFORM=$(SDL_PLATFORM) -Psdl_build.gpr -cargs `sdl2-config --cflags`
#####################################################################################
# Maths library
test_maths_build.gpr: build_test/libmaths.so
$(GPRMAKE) $(DEBUG) -p -gnat2012 -XSDL_PLATFORM=$(SDL_PLATFORM) -Ptest_maths_build.gpr
#####################################################################################
# Tests
test.gpr: build_test/test
$(GPRMAKE) $(DEBUG) -p -gnat2012 -XSDL_PLATFORM=$(SDL_PLATFORM) -Ptest.gpr -largs $(SDL2_LIBS)
#####################################################################################
# Unit tests
unit_tests: unit_tests.gpr
unit_tests.gpr: build_unit_tests/unit_tests
$(GPRMAKE) $(DEBUG) -p -gnat2012 -XSDL_PLATFORM=$(SDL_PLATFORM) -Punit_tests.gpr -largs $(SDL2_LIBS)
#####################################################################################
.PHONY: lib/libadasdl.a build_test/libmaths.so build_test/test build_unit_tests/unit_tests clean clean_test
clean: clean_test
$(GPRCLEAN) -Psdl_build.gpr -XSDL_PLATFORM=$(SDL_PLATFORM)
$(GPRCLEAN) -Ptest_maths_build.gpr -XSDL_PLATFORM=$(SDL_PLATFORM)
$(GPRCLEAN) -Ptest.gpr -XSDL_PLATFORM=$(SDL_PLATFORM)
$(GPRCLEAN) -Punit_tests.gpr -XSDL_PLATFORM=$(SDL_PLATFORM)