pkg-config/Makefile.am
Dan Nicholson e68baa7463 Add optional usage of gcov for test coverage
Use gcov to find how much code coverage our current testing gets. This
can be enabled by passing --with-gcov to configure and running "make
gcov". This is limited to gcc. Here's a run from the current code (for
some reason, gcov insists on profiling gstring.h).

/usr/bin/gcov pkg.h pkg.c parse.h parse.c main.c
File 'pkg.c'
Lines executed:73.16% of 611
pkg.c:creating 'pkg.c.gcov'

File '/usr/include/glib-2.0/glib/gstring.h'
Lines executed:100.00% of 6
/usr/include/glib-2.0/glib/gstring.h:creating 'gstring.h.gcov'

File 'parse.c'
Lines executed:79.67% of 492
parse.c:creating 'parse.c.gcov'

File 'main.c'
Lines executed:57.34% of 293
main.c:creating 'main.c.gcov'
2012-09-28 05:45:37 -07:00

60 lines
1.5 KiB
Makefile

ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
if INTERNAL_GLIB
GLIB_SUBDIR = glib
endif
# Normally we'd want glib to be part of DIST_SUBDIRS unconditionally,
# but distclean gets broken unless we always run glib's configure
SUBDIRS = $(GLIB_SUBDIR) . check
DIST_SUBDIRS = $(SUBDIRS)
# Escape paths properly on windows
if NATIVE_WIN32
AM_CPPFLAGS = \
-DPKG_CONFIG_PC_PATH="\"$(subst /,\/,$(pc_path))\"" \
-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(subst /,\/,$(system_include_path))\"" \
-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(subst /,\/,$(system_library_path))\""
else
AM_CPPFLAGS = \
-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" \
-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(system_include_path)\"" \
-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(system_library_path)\""
endif
AM_CFLAGS = \
$(WARN_CFLAGS) \
$(GCOV_CFLAGS) \
$(GLIB_CFLAGS)
bin_PROGRAMS = pkg-config
pkg_config_LDADD = $(GLIB_LIBS)
pkg_config_SOURCES= \
pkg.h \
pkg.c \
parse.h \
parse.c \
main.c
# Various data files
m4dir = $(datadir)/aclocal
dist_m4_DATA = pkg.m4
dist_doc_DATA = pkg-config-guide.html
dist_man_MANS = pkg-config.1
EXTRA_DIST = README.win32
# gcov test coverage
gcov:
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(GCOV) $(pkg_config_SOURCES)
CLEANFILES = *.gcda *.gcno *.gcov
# Since we can't always have glib in DIST_SUBDIRS, we need to make sure
# glib is configured when we want to run dist. Unfortunately, there's no
# DIST_CONFIGURE_FLAGS.
DISTCHECK_CONFIGURE_FLAGS = --with-internal-glib
if !INTERNAL_GLIB
dist-hook:
@echo "error: --with-internal-glib is required to include glib in dist"
@exit 1
endif