1 cov_cflags
= $(CFLAGS
) -O0
-ftest-coverage
-fprofile-arcs
2 cov_ldflags
= $(LDFLAGS
) -lgcov
4 gcovflags
= --preserve-paths
--branch-probabilities
--all-blocks \
6 .PHONY
: coverage-clean coverage-build coverage-show coverage-gen
7 cov_src
= cmogstored.c
$(mog_src
) $(RL_MAIN
)
9 # this doesn't work in out-of-tree builds, yet...
10 cover_db
= $(top_srcdir
)/cover_db
12 COVERAGE_JUNK
= *.gcov
*.gcda
*.gcno
13 CLEANFILES
+= $(COVERAGE_JUNK
)
14 CLEANFILES
+= $(addprefix bsd
/, $(COVERAGE_JUNK
))
15 CLEANFILES
+= $(addprefix lib
/, $(COVERAGE_JUNK
))
16 CLEANFILES
+= $(addprefix nostd
/, $(COVERAGE_JUNK
))
17 CLEANFILES
+= $(addprefix test/, $(COVERAGE_JUNK
))
23 COVERAGE_CHECK
= check
24 coverage-build
: coverage-clean
25 $(MAKE
) CFLAGS
="$(cov_cflags)" LDFLAGS
="$(cov_ldflags)"
27 $(MAKE
) CFLAGS
="$(cov_cflags)" LDFLAGS
="$(cov_ldflags)" \
31 COVER_IGNORE
= $(addprefix -ignore
,$(RL_CGEN
)) -ignore_re ^lib
/
33 @cover
$(COVER_IGNORE
) -summary
-report text
$(cover_db
)
36 $(GCOV
) $(gcovflags
) --object-directory
=$(top_builddir
) \
37 $(addprefix $(top_srcdir
)/,$(cov_src
))
38 $(AM_V_GEN
)gcov2perl
-db
$(cover_db
) *.gcov
>/dev
/null
2>&1
39 @echo Run
'"'make coverage-show
'"' to view summary
41 coverage
: coverage-build
42 $(MAKE
) coverage-check
44 @echo Run
'"'make coverage-show
'"' to view summary