|
@@ -27,6 +27,14 @@ ASM_OBJS=$(patsubst %.asm,%.o,$(ASM_SOURCES))
|
27
|
27
|
OBJS=$(ASM_OBJS) $(C_OBJS)
|
28
|
28
|
LIB=pyrpn.so
|
29
|
29
|
|
|
30
|
+CFLAGS_COV=$(CFLAGS) --coverage
|
|
31
|
+LDFLAGS_COV=$(LDFLAGS)
|
|
32
|
+C_OBJS_COV=$(patsubst %.c,%_cov.o,$(C_SOURCES))
|
|
33
|
+C_GCNO=$(patsubst %.o,%.gcno,$(C_OBJS_COV))
|
|
34
|
+C_GCDA=$(patsubst %.o,%.gcda,$(C_OBJS_COV))
|
|
35
|
+OBJS_COV=$(ASM_OBJS) $(C_OBJS_COV)
|
|
36
|
+LIB_COV=tests/pyrpn.so
|
|
37
|
+
|
30
|
38
|
all: .deps pyrpn.so
|
31
|
39
|
|
32
|
40
|
$(C_OBJS): %.o: %.c $(HEADERS)
|
|
@@ -38,6 +46,14 @@ $(ASM_OBJS): %.o: %.asm $(HEADERS)
|
38
|
46
|
$(LIB): $(OBJS)
|
39
|
47
|
$(LD) $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@ $^
|
40
|
48
|
|
|
49
|
+
|
|
50
|
+$(C_OBJS_COV): %_cov.o: %.c $(HEADERS)
|
|
51
|
+ $(CC) $(PYTHON_CFLAGS) $(CFLAGS_COV) -c -o $@ $<
|
|
52
|
+
|
|
53
|
+$(LIB_COV): $(OBJS_COV)
|
|
54
|
+ gcc $(LDFLAGS_COV) $(PYTHON_LDFLAGS) -o $@ $^ --coverage -lgcov
|
|
55
|
+
|
|
56
|
+
|
41
|
57
|
# Doxygen documentation
|
42
|
58
|
doc: doc/.doxygen.stamp
|
43
|
59
|
|
|
@@ -63,8 +79,18 @@ benchmark: $(LIB)
|
63
|
79
|
PYTHONPATH=`pwd` $(PYTHON) tests/benchmark.py 0x500 0x4000;
|
64
|
80
|
|
65
|
81
|
|
66
|
|
-unittest: $(LIB)
|
67
|
|
- PYTHONPATH=`pwd` $(PYTHON) -m unittest -v -f
|
|
82
|
+unittest: $(LIB_COV)
|
|
83
|
+ cd tests;\
|
|
84
|
+ $(PYTHON) -m unittest -v -f
|
|
85
|
+
|
|
86
|
+lcov.info: unittest runtest
|
|
87
|
+ lcov --no-external --base-directory ./ --capture --directory ./ --output-file $@
|
|
88
|
+
|
|
89
|
+lcov_html: lcov.info
|
|
90
|
+ genhtml $< --output-directory $@
|
|
91
|
+
|
|
92
|
+coverage: lcov_html
|
|
93
|
+
|
68
|
94
|
|
69
|
95
|
runtest:
|
70
|
96
|
make -C tests
|
|
@@ -72,6 +98,7 @@ runtest:
|
72
|
98
|
clean:
|
73
|
99
|
-rm -fv $(OBJS) $(LIB) test;\
|
74
|
100
|
rm -fRv doc/.doxygen.stamp doc/* Doxyfile;\
|
|
101
|
+ rm -fRv $(OBJS_COV) $(C_GCNO) $(C_GCDA) $(LIB_COV) lcov_html lcov.info;\
|
75
|
102
|
make -C tests clean
|
76
|
103
|
|
77
|
104
|
distclean: clean
|