## Process this file with automake to produce Makefile.in
-include $(top_srcdir)/gcov.mak
-
-GCOVSOURCES =
-
-if GI_GCOV_ENABLED
-GCOV_DIRS = girepository tools
-
-check-coverage: coverage-report.txt
- @cat $(top_builddir)/coverage-report.txt
-
-else
-
-check-coverage:
- @echo "ERROR: Need to reconfigure with --enable-gcov to run make check-coverage"
-
-endif
-
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = girepository giscanner tools gir docs tests examples
+++ /dev/null
-# -*- Mode: makefile -*-
-if GI_GCOV_ENABLED
-
-clean-gcov:
- find . -name "*.gcda" -o -name "*.gcov" -delete
-
-clean-gcno:
- find . -name "*.gcno" -delete
-
-gcov-all:
- @for dir in $(GCOV_DIRS); do \
- cd $(abs_srcdir)/$$dir && \
- for file in *.c; do \
- gcov -f -p -o `find $(abs_builddir)/$$dir -newer $$file -name "*-$${file/.c/.gcda}" -print0 | sed -e 's/\.gcda/\.o/'` $$file > /dev/null; \
- done \
- done
-
-coverage-report.txt: clean clean-gcov all check gcov-all
- @rm -f $(top_builddir)/coverage-report.txt
- @echo -e "=== Coverage Report ===\n" >> $(top_builddir)/coverage-report.txt
- @for dir in $(GCOV_DIRS); do \
- echo "Module '$$dir':" >> $(top_builddir)/coverage-report.txt; \
- $(MAKE) -C $$dir coverage-report; \
- done
-
-coverage-report:
- @total_covered=0; total_lines=0; \
- for file in $(GCOVSOURCES); do \
- if test -f $$file.gcov; then \
- covered=`grep -e '[0-9]\+:' $$file.gcov | wc -l` ; \
- uncovered=`grep '#####:' $$file.gcov | wc -l`; \
- lines=$$(($$covered + $$uncovered)); \
- total_covered=$$((total_covered + covered)); \
- total_lines=$$((total_lines + lines)); \
- echo -n " $$file: $$covered / $$lines"; \
- echo " ($$((($$covered * 100) / $$lines))%)"; \
- fi \
- done >> $(top_builddir)/coverage-report.txt; \
- echo -e " Total coverage:"\
- "$$((($$total_covered * 100) / $$total_lines))%\n" \
- >> $(top_builddir)/coverage-report.txt
-
-.PHONEY: coverage-report gcov-all coverage-report.txt
-
-endif
-include $(top_srcdir)/gcov.mak
-
-GCOVSOURCES = $(libgirepository_1_0_la_SOURCES)
-
girepodir = $(includedir)/gobject-introspection-1.0/
girepo_HEADERS = girepository.h girffi.h
libgiscanner_la_LIBADD = $(GOBJECT_LIBS)
libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS)
-GCOVSOURCES = $(libgiscanner_la_SOURCES)
-
# Python module
pkgpyexecdir = $(pkglibdir)/giscanner
pkgpyexec_LTLIBRARIES = _giscanner.la
rm $(pkgpyexecdir)/_giscanner.dll.a
rm $(pkgpyexecdir)/_giscanner.la
endif
-
-include $(top_srcdir)/gcov.mak
-EXTRA_DIST=gcov.m4 as-compiler-flag.m4
+EXTRA_DIST=as-compiler-flag.m4
+++ /dev/null
-AC_DEFUN([GI_ENABLE_GCOV],
-[
- AC_ARG_ENABLE(gcov,
- AC_HELP_STRING([--enable-gcov],
- [compile with coverage profiling instrumentation (gcc only)]),
- enable_gcov=$enableval,
- enable_gcov=no)
- if test x$enable_gcov = xyes ; then
- if test "x$GCC" != "xyes"
- then
- AC_MSG_ERROR([gcov only works if gcc is used])
- fi
-
- AS_COMPILER_FLAG(["-fprofile-arcs"],
- [GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs"],
- true)
- AS_COMPILER_FLAG(["-ftest-coverage"],
- [GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage"],
- true)
- dnl libtool 1.5.22 and lower strip -fprofile-arcs from the flags
- dnl passed to the linker, which is a bug; -fprofile-arcs implicitly
- dnl links in -lgcov, so we do it explicitly here for the same effect
- GCOV_LIBS=-lgcov
- AC_SUBST(GCOV_CFLAGS)
- AC_SUBST(GCOV_LIBS)
- GCOV=`echo $CC | sed s/gcc/gcov/g`
- AC_SUBST(GCOV)
-
- GI_GCOV_ENABLED=yes
- AC_DEFINE_UNQUOTED(GI_GCOV_ENABLED, 1,
- [Defined if gcov is enabled to force a rebuild due to config.h changing])
- dnl if gcov is used, we do not want default -O2 CFLAGS
- if test "x$GI_GCOV_ENABLED" = "xyes"
- then
- CFLAGS="-g -O0"
- AC_SUBST(CFLAGS)
- CXXFLAGS="-g -O0"
- AC_SUBST(CXXFLAGS)
- FFLAGS="-g -O0"
- AC_SUBST(FFLAGS)
- CCASFLAGS="-g -O0"
- AC_SUBST(CCASFLAGS)
- AC_MSG_NOTICE([gcov enabled, setting CFLAGS and friends to $CFLAGS])
- fi
- fi
- AM_CONDITIONAL(GI_GCOV_ENABLED, test x$enable_gcov = xyes)
-])
-include $(top_srcdir)/gcov.mak
-
INCLUDES = \
-DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \
-I$(top_srcdir)/girepository