687d896f6619cd4a0b074778696fbf1e9f20c5c5
[strongswan.git] / Makefile.am
1 SUBDIRS = src man init testing
2
3 if USE_SCRIPTS
4   SUBDIRS += scripts
5 endif
6
7 if USE_SILENT_RULES
8   AM_MAKEFLAGS = -s
9 endif
10
11 ACLOCAL_AMFLAGS = -I m4/config
12
13 EXTRA_DIST = Doxyfile.in LICENSE Android.common.mk.in Android.common.mk Android.mk
14 CLEANFILES = Doxyfile
15 BUILT_SOURCES = Android.common.mk
16 MAINTAINERCLEANFILES = Android.common.mk
17
18 if USE_DEV_HEADERS
19 config_includedir = $(ipseclibdir)/include
20 nodist_config_include_HEADERS = config.h
21 endif
22
23 Android.common.mk :     Android.common.mk.in configure.ac
24                 $(AM_V_GEN) \
25                 sed \
26                 -e "s:\@PACKAGE_VERSION\@:$(PACKAGE_VERSION):" \
27                 $(srcdir)/$@.in > $@
28
29 Doxyfile :      Doxyfile.in
30                 $(AM_V_GEN) \
31                 sed \
32                 -e "s:\@PACKAGE_VERSION\@:$(PACKAGE_VERSION):" \
33                 -e "s:\@PACKAGE_NAME\@:$(PACKAGE_NAME):" \
34                 -e "s:\@SRC_DIR\@:$(srcdir):" \
35                 $(srcdir)/$@.in > $@
36
37 apidoc :        Doxyfile
38                 doxygen
39
40 cov-reset-common:
41                 @rm -rf $(top_builddir)/coverage
42                 @find $(top_builddir)/{src,scripts} -name "*.gcda" -delete
43
44 if COVERAGE
45 cov-reset: cov-reset-common
46                 @lcov --zerocounters --directory $(top_builddir)
47
48 cov-report:
49                 @mkdir $(top_builddir)/coverage
50                 lcov -c -o $(top_builddir)/coverage/coverage.info -d $(top_builddir) \
51                          --rc lcov_branch_coverage=1
52                 lcov -r $(top_builddir)/coverage/coverage.info '*/tests/*' \
53                          -o $(top_builddir)/coverage/coverage.cleaned.info \
54                          --rc lcov_branch_coverage=1
55                 genhtml --num-spaces 4 --legend --branch-coverage \
56                                 -t "$(PACKAGE_STRING)" \
57                                 -o $(top_builddir)/coverage/html \
58                                 -p `readlink -m $(abs_top_srcdir)`/src \
59                                 $(top_builddir)/coverage/coverage.cleaned.info
60                 @echo "Coverage Report at $(top_builddir)/coverage/html" >&2
61
62 coverage:
63                 @$(MAKE) cov-reset
64                 @$(MAKE) check
65                 @$(MAKE) cov-report
66 else
67 coverage:
68                 @echo "reconfigure with --enable-coverage"
69 endif
70
71 clean-local: cov-reset-common
72                 @find $(top_builddir)/{src,scripts} -name "*.gcno" -delete
73                 @rm -rf apidoc
74
75 .PHONY: cov-reset-common cov-reset cov-report coverage