-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
114 lines (82 loc) · 3.24 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
#
# Read COPYING for licensing details.
#
# Garrett Cooper, June 2010
#
# Makefiles that are considered critical to execution; if they don't exist
# all of the Makefiles will be rebuilt by default.
CRITICAL_CONFORMANCE_MAKEFILE= conformance/interfaces/timer_settime/Makefile
CRITICAL_FUNCTIONAL_MAKEFILE= functional/threads/pi_test/Makefile
CRITICAL_SECTION_MAKEFILE= stress/threads/sem_open/Makefile
CRITICAL_MAKEFILES= $(CRITICAL_CONFORMANCE_MAKEFILE) \
$(CRITICAL_FUNCTIONAL_MAKEFILE) \
$(CRITICAL_SECTION_MAKEFILE)
# The default logfile for the tests.
LOGFILE?= logfile
# Subdirectories to traverse down.
SUBDIRS= conformance functional stress
MAKE_ENV= LOGFILE=`if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
BUILD_MAKE_ENV= "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)"
BUILD_MAKE_ENV+= "LDLIBS=$(LDLIBS)" $(MAKE_ENV)
TEST_MAKE_ENV= $(MAKE_ENV)
BUILD_MAKE= env $(BUILD_MAKE_ENV) $(MAKE)
TEST_MAKE= env $(TEST_MAKE_ENV) $(MAKE) -k
top_srcdir?= .
prefix?= `$(top_srcdir)/scripts/print_prefix.sh`
datadir?= $(prefix)/share
exec_prefix?= $(prefix)
all: conformance-all functional-all stress-all tools-all
clean: $(CRITICAL_MAKEFILES)
@rm -f $(LOGFILE)*
@for dir in $(SUBDIRS) tools; do \
$(MAKE) -C $$dir clean >/dev/null; \
done
distclean: distclean-makefiles
# Clean out all of the generated Makefiles.
distclean-makefiles:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $@; \
done
generate-makefiles: distclean-makefiles
@env top_srcdir=$(top_srcdir) \
$(top_srcdir)/scripts/generate-makefiles.sh
install: bin-install conformance-install functional-install stress-install
test: conformance-test functional-test stress-test
# Test build and execution targets.
conformance-all: $(CRITICAL_CONFORMANCE_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C conformance -j1 all
conformance-install:
@$(MAKE) -C conformance install
conformance-test:
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(TEST_MAKE) -C conformance test
functional-all: $(CRITICAL_FUNCTIONAL_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C functional -j1 all
functional-install:
@$(MAKE) -C functional install
functional-test:
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(TEST_MAKE) -C functional test
stress-all: $(CRITICAL_STRESS_MAKEFILE)
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(BUILD_MAKE) -C stress -j1 all
stress-install:
@$(MAKE) -C stress install
stress-test:
@rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@
@$(TEST_MAKE) -C stress test
# Tools build and install targets.
bin-install:
@$(MAKE) -C bin install
tools-all:
@$(MAKE) -C tools all
$(CRITICAL_MAKEFILES): \
$(top_srcdir)/scripts/generate-makefiles.sh \
$(top_srcdir)/CFLAGS \
$(top_srcdir)/LDFLAGS \
$(top_srcdir)/LDLIBS
@$(MAKE) generate-makefiles
#tests-pretty:
# $(MAKE) all | column -t -s: