blob: 7ffbfc4e9cafd2d33ac177c66938fac1b798a82c (
plain)
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
|
# -*-Makefile-*-
CORE_TEST := core/test/run-device core/test/run-mem_region core/test/run-malloc core/test/run-malloc-speed core/test/run-mem_region_init core/test/run-mem_region_release_unused core/test/run-mem_region_release_unused_noalloc core/test/run-trace core/test/run-msg core/test/run-pel core/test/run-pool core/test/run-timer
check: $(CORE_TEST:%=%-check) $(CORE_TEST:%=%-gcov-run)
coverage: $(CORE_TEST:%=%-gcov-run)
$(CORE_TEST:%=%-gcov-run) : %-run: %
$<
$(CORE_TEST:%=%-check) : %-check: %
$(VALGRIND) $<
core/test/stubs.o: core/test/stubs.c
$(HOSTCC) $(HOSTCFLAGS) -g -c -o $@ $<
$(CORE_TEST) : core/test/stubs.o
$(CORE_TEST) : % : %.c
$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -o $@ $< core/test/stubs.o
$(CORE_TEST): % : %.d
$(CORE_TEST:%=%-gcov): %-gcov : %.c %
$(HOSTCC) $(HOSTCFLAGS) -fprofile-arcs -ftest-coverage -O0 -g -I include -I . -I libfdt -lgcov -o $@ $< core/test/stubs.o
$(CORE_TEST:%=%-gcov): % : $(%.d:-gcov=)
core/test/stubs.o: core/test/stubs.d
core/test/%.d: core/test/%.c
$(HOSTCC) $(HOSTCFLAGS) -I include -I . -I libfdt -M $< > $@
-include $(wildcard core/test/*.d)
clean: core-test-clean
core-test-clean:
$(RM) -f core/test/*.[od] $(CORE_TEST) $(CORE_TEST:%=%-gcov)
$(RM) -f *.gcda *.gcno skiboot.info
$(RM) -rf coverage-report
|