-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.in
84 lines (62 loc) · 1.55 KB
/
Makefile.in
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
SRC_DIR=src/
VALGRIND_OPTS=--leak-check=full --show-leak-kinds=all --track-origins=yes
REDIRECT=>/dev/null 2>&1
.PHONY: all test clean distclean
none:
@echo "Use make with a target:"
@echo ""
@echo " make all"
@echo ""
@echo " make test"
@echo " make memtest"
@echo " make coverage"
@echo " make report"
@echo ""
@echo " make clean"
@echo " make distclean"
@echo ""
all: game-of-decay
game-of-decay:
cd $(SRC_DIR) && $(MAKE) $@
test:
cd test/ && $(MAKE) $@
coverage: test
@if which lcov $(REDIRECT); then \
lcov -c -d . -o test/coverage.info-file; \
genhtml test/coverage.info-file -o test/coverage/; \
echo "Your coverage report is in test/coverage/index.html"; \
else \
echo "You must install lcov first!"; \
fi
memtest: test
@if which valgrind $(REDIRECT); then \
if test -f test/test $(REDIRECT); then \
valgrind $(VALGRIND_OPTS) test/test; \
else \
echo "No test binary found. Did your build succeed?"; \
fi \
else \
echo "You must install valgrind first!"; \
fi
report: coverage
@if which gcovr $(REDIRECT); then \
gcovr --exclude="test/test.c" -r . ; \
else \
echo "You must install gcovr first!"; \
fi
clean:
cd src/ && $(MAKE) $@
cd test/ && $(MAKE) $@
rm -f config.log config.status
distclean: clean
rm -rf autom4te.cache
rm -f Makefile
rm -f configure
cd src/ && $(MAKE) $@
cd test/ && $(MAKE) $@
@if which autoconf $(REDIRECT); then \
echo "Generating new configure script..."; \
autoconf; \
else \
echo "Unable to generate new configure script!"; \
fi \