-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (79 loc) · 2.1 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
include ../build-cfg/mk/Makeconf
# Library projects
LIBS = \
libmuxml \
libmutools \
libmucfgcheck \
libmucfgvcpu \
liballoc \
libpaging
# Library projects with no unit test suite
LIBS_NO_TESTS = \
libmulog \
libtest
# Tool projects
TOOLS = \
mucbinsplit \
mucfgalloc \
mucfgcjoin \
mucfgcvresalloc \
mucfgvresalloc \
mucfgexpand \
mucfgmemhashes \
mucfgmerge \
mucfgucode \
mucfgvalidate \
mucgenspec \
mucheckelf \
mucheckstack \
mugenacpi \
mugenmsrstore \
mugensinfo \
mugensolo5 \
mugenspec \
mugentau0cmds \
mugenzp \
muwalkpt \
muxmlfilter \
sbs
# Projects to test
TESTS := $(LIBS) $(TOOLS)
TESTS := $(filter-out sbs,$(TESTS))
MUEN_TOOLS ?= \
$(LIBS) \
$(LIBS_NO_TESTS) \
$(TOOLS)
# Projects to prepare
PREPARE := $(MUEN_LIBS) $(MUEN_TOOLS)
INSTALL := $(filter-out lib%,$(MUEN_TOOLS))
TOOLS_PREPARE = $(MUEN_TOOLS:%=.prepare-%)
TOOLS_INSTALL = $(INSTALL:%=install-%)
TOOLS_CLEAN = $(MUEN_TOOLS:%=clean-%)
LOG = $(OBJ_DIR)/tools.log
all: build_tools
build_tools: $(OBJ_DIR)/build.gpr $(TOOLS_PREPARE)
@$(E) tools Build "gprbuild $(BUILD_OPTS) -P$<" $(LOG)
tests:
for prj in $(TESTS); do $(MAKE) $@ -C $$prj || exit 1; done
install: $(TOOLS_INSTALL)
$(TOOLS_INSTALL): build_tools
$(MAKE) -C $(@:install-%=%) install
clean: $(TOOLS_CLEAN)
rm -rf $(OBJ_DIR) .prepare-*
$(TOOLS_CLEAN):
$(MAKE) -C $(@:clean-%=%) clean
prepare: $(TOOLS_PREPARE)
$(TOOLS_PREPARE):
$(MAKE) -C $(@:.prepare-%=%) prepare
@touch $@
$(OBJ_DIR):
mkdir -p $@
$(OBJ_DIR)/build.gpr: | $(OBJ_DIR)
@echo 'aggregate project Build is' > $@
@echo ' for Project_Files use (' >> $@
@$(foreach c,$(MUEN_TOOLS),echo -n ' "../$(c)/$(c).gpr"' >> $@; \
if [ $(c) != $(lastword $(MUEN_TOOLS)) ]; then echo ',' >> $@; \
else echo '' >> $@; fi;)
@echo ' );' >> $@
@echo 'end Build;' >> $@
.PHONY: $(OBJ_DIR)/build.gpr