forked from graphbig/graphBIG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.mk
61 lines (37 loc) · 989 Bytes
/
gen.mk
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
# SUBDIR & ROOT should be predefined
# before include this mk file
BUILDDIRS=$(SUBDIR:%=build-%)
CLEANDIRS=$(SUBDIR:%=clean-%)
RUNDIRS=$(SUBDIR:%=run-%)
TESTDIRS=$(SUBDIR:%=test-%)
HELPDIRS=$(word 1, ${SUBDIR})
default: all
all: pfm_cxx ${BUILDDIRS}
${BUILDDIRS}:
@${MAKE} -C $(@:build-%=%) all
pfm_cxx:
@${MAKE} --no-print-directory -C ${ROOT}/tools all
clean: ${CLEANDIRS}
@rm -f output.log
${CLEANDIRS}:
@${MAKE} -C $(@:clean-%=%) clean
run: pfm_cxx ${RUNDIRS}
@rm -f output.log
@for d in ${SUBDIR}; do \
cat $$d/output.log >> output.log; \
done
${RUNDIRS}:
@${MAKE} -s -C $(@:run-%=%) run
verify: pfm_cxx ${TESTDIRS}
${TESTDIRS}:
@${MAKE} -s -C $(@:test-%=%) verify
travis-verify: pfm_cxx ${TRAVIS_DIR:%=test-%}
help: ${HELPDIRS}
${HELPDIRS}:
@${MAKE} -s -C $@ help
.PHONY: subdirs $(RUNDIRS)
.PHONY: subdirs $(BUILDDIRS)
.PHONY: subdirs $(HELPDIRS)
.PHONY: subdirs $(TESTDIRS)
.PHONY: subdirs $(CLEANDIRS)
.PHONY: all run clean verify pfm_cxx