1 # auxdevel.am -- Makefile snippet to be included in Makefile.am for projects
2 # making use of auxdevel.m4
4 # This file appends data to many Make variables. It would be an error to append
5 # to an undefined variable. However, if you're using auxdevel.m4, it takes care
6 # of that by defining the variables used here with empty values.
8 # This file set some flags in AM_CFLAGS and LDADD. Be careful that these global
9 # variables will be overwritten by target-specific _CFLAGS and _LDADD/_LIBADD.
13 AM_CFLAGS += -I$(csourcedir) $(if $(headerdir), -I$(headerdir),)
14 AM_CFLAGS += $(ac_devel_default_warnings)
17 AM_CFLAGS += -fprofile-arcs -ftest-coverage
18 MOSTLYCLEANFILES += *.bb *.bbg *.gcno
19 CLEANFILES += *.da *.gcda *.lcov
27 clean-local: clean-docs
31 doxygen: docs Doxyfile
33 (cat Doxyfile; echo "OUTPUT_DIRECTORY = " \"$(DOXYOUT)\" ) \
37 LCOVOUT=docs/lcov-reports
38 LCOVLOG=docs/lcov_log.txt
40 # TODO: the first sed regexp is due to a gcov/lcov bug which adds a
41 # trailing build/ in the path to source. This should be better investigated.
43 # TODO: the second sed regexp removes "..". It would be best if we could do that
46 # TODO: for GCOV reasons a symlink pointing to $(csourcedir) is needed when
47 # building in a directory outside of $(sourcedir) even thought we remove
48 # the trailing build/ from pathnames.
51 @[ ! -e $$(basename $(csourcedir)) ] && ln -s $(csourcedir) . || true
53 rm -f .lcov_test_run_error; \
54 for test in $(TESTS); do \
55 lcov --zerocounters --directory . --quiet ;\
57 (./$$test 2>&1 || touch .lcov_test_run_error) \
58 | grep -E -v '^arc profiling: Can.t open output file' \
59 | grep -E -v '(Electric Fence.*Bruce Perens|^$$)' ;\
61 lcov --capture --directory . \
62 --output-file $$test-info.lcov \
63 --test-name "$$test (check)" --quiet ;\
65 for testdir in "$(abs_utestdir)" "$(abs_mytestdir)" $(lcov_ignore_dirs); do \
66 test "$$testdir" && lcov --remove $$test-info.lcov \
68 --quiet -o $$test-info.lcov ;\
71 -e "/^SF:/s;$(ac_devel_abs_builddir);$(ac_devel_abs_srcdir);" \
74 genhtml *.lcov --output-directory=$(LCOVOUT) \
75 | grep 'Overall coverage rate' ) | tee $(LCOVLOG)
76 @[ -L $$(basename $(csourcedir)) ] && rm $$(basename $(csourcedir)) || true
77 @[ ! -f .lcov_test_run_error ]
82 .PHONY: doc doxygen lcov