[cairo-commit] Makefile.am

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 27 09:46:59 PDT 2007


 Makefile.am |   29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

New commits:
diff-tree d837a458b95c0e1866eecaf3688dfa36e7dafe8e (from abe1b89da4a2aa255a218103c7a05711d0f73b1c)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 27 17:45:51 2007 +0100

    [configure] Work-around bad interaction of libtool and lcov
    
    libtool causes the .gcda files to be generated in the .libs/ directory,
    separate from the .c source file. lcov expects them to be in the same
    directory - so massage the lcov.info file to remove the reference to the
    .libs/.
    
    Also separate the target for generating the lcov output, so that it can
    be run independently from triggering the tests. And improve convenience
    of using the other lcov targets.

diff --git a/Makefile.am b/Makefile.am
index 0ec2404..5f3ddfd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,17 +22,28 @@ check-valgrind: all
 	cd perf && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
 perf: all
 	cd perf && $(MAKE) $(AM_MAKEFLAGS) perf
-lcov: check
-	$(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_TEST --no-checksum
-	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-test-lcov --title "Cairo Test Code Coverage" --show-details cairo-test-lcov.info
-lcov-perf: perf
-	$(LTP) --directory $(top_builddir) --capture --output-file cairo-perf-lcov.info --test-name CAIRO_PERF --no-checksum
-	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-perf-lcov --title "Cairo Perf Code Coverage" --show-details cairo-perf-lcov.info
+
+.PHONY: lcov lcov-perf genlcov lcov-clean
+# use recursive makes in order to ignore errors during check/perf
+lcov:
+	-$(MAKE) $(AM_MAKEFLAGS) check
+	$(MAKE) $(AM_MAKEFLAGS) genlcov
+lcov-perf:
+	-$(MAKE) $(AM_MAKEFLAGS) perf
+	$(MAKE) $(AM_MAKEFLAGS) genlcov
+
+# we have to massage the lcov.info file slightly to hide the effect of libtool
+# placing the objects files in the .libs/ directory separate from the *.c
+genlcov:
+	$(LTP) --directory $(top_builddir) --capture --output-file cairo-lcov.info --test-name CAIRO_PERF --no-checksum
+	$(SED) -e 's#.libs/##' < cairo-lcov.info > cairo-lcov.info.tmp
+	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory cairo-lcov --title "Cairo Code Coverage" --show-details cairo-lcov.info.tmp
+	rm -f cairo-lcov.info.tmp
+
 lcov-clean:
 	$(LTP) --directory $(top_builddir) --reset
-	$(RM) -rf \
-	    cairo-test-lcov.info cairo-test-lcov \
-	    cairo-perf-lcov.info cairo-perf-lcov
+	$(RM) -rf cairo-lcov.info cairo-lcov
+	$(FIND) -name '*.gcda' -print0 | xargs -0 rm
 
 EXTRA_DIST = \
 	AUTHORS \


More information about the cairo-commit mailing list