|
1 | 1 | # -*-makefile-*-
|
2 |
| -# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.243 2008/09/05 12:11:18 petere Exp $ |
| 2 | +# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.244 2008/10/03 15:35:17 petere Exp $ |
3 | 3 |
|
4 | 4 | #------------------------------------------------------------------------------
|
5 | 5 | # All PostgreSQL makefiles include this file and use the variables it sets,
|
@@ -592,18 +592,30 @@ endif # enable_nls
|
592 | 592 | #
|
593 | 593 | # Coverage
|
594 | 594 |
|
| 595 | +# Explanation of involved files: |
| 596 | +# foo.c source file |
| 597 | +# foo.o object file |
| 598 | +# foo.gcno gcov graph (a.k.a. "notes") file, created at compile time |
| 599 | +# (by gcc -ftest-coverage) |
| 600 | +# foo.gcda gcov data file, created when the program is run (for |
| 601 | +# programs compiled with gcc -fprofile-arcs) |
| 602 | +# foo.c.gcov gcov output file with coverage information, created by |
| 603 | +# gcov from foo.gcda (by "make coverage") |
| 604 | +# foo.c.gcov.out stdout captured when foo.c.gcov is created, mildly |
| 605 | +# interesting |
| 606 | +# lcov.info lcov tracefile, built from gcda files in one directory, |
| 607 | +# later collected by "make coverage-html" |
| 608 | + |
595 | 609 | ifeq ($(enable_coverage), yes)
|
596 | 610 |
|
597 | 611 | # There is a strange interaction between lcov and existing .gcov
|
598 | 612 | # output files. Hence the rm command and the ordering dependency.
|
599 | 613 |
|
600 | 614 | gcda_files := $(wildcard *.gcda)
|
601 | 615 |
|
602 |
| -lcov.info: |
| 616 | +lcov.info: $(gcda_files) |
603 | 617 | rm -f *.gcov
|
604 |
| -ifneq (,$(gcda_files)) |
605 |
| - $(LCOV) -d . -c -o $@ $(LCOVFLAGS) |
606 |
| -endif |
| 618 | + $(if $^,$(LCOV) -d . -c -o $@ $(LCOVFLAGS)) |
607 | 619 |
|
608 | 620 | %.c.gcov: %.gcda | lcov.info
|
609 | 621 | $(GCOV) -b -f -p -o . $(GCOVFLAGS) $*.c >$*.c.gcov.out
|
|
0 commit comments