forked from AdaCore/libadalang-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
114 lines (98 loc) · 2.89 KB
/
Makefile
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
# To build in production mode, do "make LIBRARY_TYPE=static BUILD_MODE=prod".
# To build in development mode, do "make LIBRARY_TYPE=static BUILD_MODE=dev".
BUILD_MODE ?= dev
LIBRARY_TYPE ?= static
LALTOOLS_SET ?= all
PROCESSORS ?= 0
ALL_LIBRARY_TYPES = static static-pic relocatable
LIB_PROJECTS = \
src/lal_tools.gpr
BIN_PROJECTS = \
src/build.gpr
TESTSUITE_PROJECTS = \
testsuite/ada_drivers/refactor_imports/refactor_imports.gpr \
testsuite/ada_drivers/outgoing_calls/outgoing_calls.gpr \
testsuite/ada_drivers/refactoring_safe_rename/safe_rename.gpr \
testsuite/ada_drivers/add_parameter/add_parameter.gpr \
testsuite/ada_drivers/remove_parameter/remove_parameter.gpr \
testsuite/ada_drivers/move_parameter/move_parameter.gpr \
testsuite/ada_drivers/change_parameter_mode/change_parameter_mode.gpr \
testsuite/ada_drivers/suppress_separate/suppress_separate.gpr
ALL_PROJECTS = \
$(LIB_PROJECTS) $(TESTSUITE_PROJECTS)
.PHONY: lib
lib:
which gprbuild
which gcc
for proj in $(LIB_PROJECTS) ; do \
for kind in $(ALL_LIBRARY_TYPES) ; do \
rm -f obj/lib/*.lexch; \
gprbuild -v -k \
-XLIBRARY_TYPE=$$kind \
-XBUILD_MODE=$(BUILD_MODE) \
-P $$proj -p -j$(PROCESSORS) ; \
done ; \
done
.PHONY: bin
bin:
which gprbuild
which gcc
for proj in $(BIN_PROJECTS) ; do \
gprbuild -v -k \
-XLIBRARY_TYPE=$(LIBRARY_TYPE) \
-XXMLADA_BUILD=$(LIBRARY_TYPE) \
-XBUILD_MODE=$(BUILD_MODE) \
-XLALTOOLS_SET=$(LALTOOLS_SET) \
-P $$proj -p -j$(PROCESSORS) ; \
done
.PHONY: testsuite_drivers
testsuite_drivers:
which gprbuild
which gcc
for proj in $(TESTSUITE_PROJECTS) ; do \
gprbuild -v -k \
-XLIBRARY_TYPE=$(LIBRARY_TYPE) \
-XXMLADA_BUILD=$(LIBRARY_TYPE) \
-XBUILD_MODE=$(BUILD_MODE) \
-XLALTOOLS_SET=$(LALTOOLS_SET) \
-P $$proj -p -j$(PROCESSORS) ; \
done
.PHONY: all
all:
which gprbuild
which gcc
for proj in $(ALL_PROJECTS) ; do \
gprbuild -v -k \
-XLIBRARY_TYPE=$(LIBRARY_TYPE) \
-XXMLADA_BUILD=$(LIBRARY_TYPE) \
-XBUILD_MODE=$(BUILD_MODE) \
-XLALTOOLS_SET=$(LALTOOLS_SET) \
-P $$proj -p -j$(PROCESSORS) ; \
done
.PHONY: test
test: all
bin/utils-var_length_ints-test
testsuite/testsuite.py
install-lib:
for proj in $(LIB_PROJECTS) ; do \
for kind in $(ALL_LIBRARY_TYPES) ; do \
gprinstall \
-XLIBRARY_TYPE=$$kind \
-XBUILD_MODE=$(BUILD_MODE) \
--prefix="$(DESTDIR)" \
--sources-subdir=include/$$(basename $$proj | cut -d. -f1) \
--build-name=$$kind \
--build-var=LIBRARY_TYPE --build-var=LAL_TOOLS_BUILD \
-P $$proj -p -f ; \
done ; \
done
install-bin-strip:
mkdir -p "$(DESTDIR)"
cp -r bin "$(DESTDIR)/"
# Don't strip debug builds
test "$(BUILD_MODE)" = dev || strip "$(DESTDIR)/bin/"*
.PHONY: clean
clean:
rm -rf obj bin
rm -rf testsuite/ada_drivers/bin
rm -rf testsuite/ada_drivers/**/obj