-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathMakefile
57 lines (38 loc) · 1.06 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
ifeq ($(wildcard xia.mk),)
$(error You must run configure first)
else
include xia.mk
endif
# list of top level directories that need to be built
MAKEDIRS=click api daemons applications tools
# make sure we run clean in anything we built in
CLEANDIRS=$(addsuffix .build, $(MAKEDIRS))
# list of directories with automated tests that should be run
TESTDIRS=$(addsuffix .test, api)
.PHONY: all config clean test $(MAKEDIRS) $(CLEANDIRS) $(TESTDIRS)
#### BUILD RULES
#always make sure we have configured before building the sub projects
all: config $(MAKEDIRS)
static:
make all STATIC='static'
# treat click special since we want multi-proc compiles
click:
make -j$(NPROCS) -C $@
$(filter-out click, $(MAKEDIRS)):
make -C $@ $(STATIC)
#### CONFIG RULES
# add other configuration targets here as needed
config: xia.mk
@cd click && ./conf_xia
xia.mk: configure
@./configure
#### CLEAN RULES
clean: $(CLEANDIRS)
-@rm click/.configured
-@rm xia.mk
$(CLEANDIRS):
-make -C $(basename $@) clean
#### TEST RULES
test: $(TESTDIRS)
$(TESTDIRS):
make -C $(basename $@) test