-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (38 loc) · 1.39 KB
/
Makefile
File metadata and controls
55 lines (38 loc) · 1.39 KB
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
# Default optimization level
O ?= 2
TESTS = $(patsubst %.cc,%,$(sort $(wildcard test[0-9][0-9][0-9].cc)))
all: $(TESTS) hhtest
-include rules.mk
LIBS = -lm
%.o: %.cc $(BUILDSTAMP)
$(call run,$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEPCFLAGS) $(O) -o $@ -c,COMPILE,$<)
all:
@echo "*** Run 'make check' or 'make check-all' to check your work."
test%: dmalloc.o basealloc.o test%.o
$(call run,$(CXX) $(CXXFLAGS) $(O) -o $@ $^ $(LDFLAGS) $(LIBS),LINK $@)
hhtest: dmalloc.o basealloc.o hhtest.o
$(call run,$(CXX) $(CXXFLAGS) $(O) -o $@ $^ $(LDFLAGS) $(LIBS),LINK $@)
check: $(patsubst %,run-%,$(TESTS))
@echo "*** All tests succeeded!"
check-all: $(TESTS)
@good=true; for i in $(TESTS); do $(MAKE) --no-print-directory run-$$i || good=false; done; \
if $$good; then echo "*** All tests succeeded!"; fi; $$good
check-%:
@any=false; good=true; for i in `perl check.pl -e "$*"`; do \
any=true; $(MAKE) run-$$i || good=false; done; \
if $$any; then $$good; else echo "*** No such test" 1>&2; $$any; fi
run-:
@echo "*** No such test" 1>&2; exit 1
run-%: %
@test -d out || mkdir out
@perl check.pl -x $<
clean: clean-main
clean-main:
$(call run,rm -f $(TESTS) hhtest *.o core *.core,CLEAN)
$(call run,rm -rf out *.dSYM $(DEPSDIR))
distclean: clean
MALLOC_CHECK_=0
export MALLOC_CHECK_
.PRECIOUS: %.o
.PHONY: all clean clean-main clean-hook distclean \
run run- run% prepare-check check check-all check-%