Fix coverage targets so that HTML view is reliably updated when test data
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 3 Oct 2008 15:35:17 +0000 (15:35 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 3 Oct 2008 15:35:17 +0000 (15:35 +0000)
changes.  Add some documenting comments.

src/Makefile.global.in

index 5b8522237127061fe96e93367e0c5f4a84ee422a..805c60cf2ce0ab0d66449ae5a83e5d05efd5773c 100644 (file)
@@ -592,6 +592,20 @@ endif # enable_nls
 #
 # Coverage
 
+# Explanation of involved files:
+#   foo.c      source file
+#   foo.o      object file
+#   foo.gcno   gcov graph (a.k.a. "notes") file, created at compile time
+#              (by gcc -ftest-coverage)
+#   foo.gcda   gcov data file, created when the program is run (for
+#              programs compiled with gcc -fprofile-arcs)
+#   foo.c.gcov gcov output file with coverage information, created by
+#              gcov from foo.gcda (by "make coverage")
+#   foo.c.gcov.out  stdout captured when foo.c.gcov is created, mildly
+#              interesting
+#   lcov.info  lcov tracefile, built from gcda files in one directory,
+#              later collected by "make coverage-html"
+
 ifeq ($(enable_coverage), yes)
 
 # There is a strange interaction between lcov and existing .gcov
@@ -599,11 +613,9 @@ ifeq ($(enable_coverage), yes)
 
 gcda_files := $(wildcard *.gcda)
 
-lcov.info:
+lcov.info: $(gcda_files)
        rm -f *.gcov
-ifneq (,$(gcda_files))
-       $(LCOV) -d . -c -o $@ $(LCOVFLAGS)
-endif
+       $(if $^,$(LCOV) -d . -c -o $@ $(LCOVFLAGS))
 
 %.c.gcov: %.gcda | lcov.info
        $(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out