NEWS: Added changes since 5.3.4
[strongswan.git] / Makefile.am
1 SUBDIRS = src man conf 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 # we leave config files behind intentionally so prevent distcheck from complaining
24 distuninstallcheck_listfiles = find . -type f \! -name '*.conf' -print
25
26 Android.common.mk :     Android.common.mk.in configure.ac
27                 $(AM_V_GEN) \
28                 sed \
29                 -e "s:\@PACKAGE_VERSION\@:$(PACKAGE_VERSION):" \
30                 $(srcdir)/$@.in > $@
31
32 Doxyfile :      Doxyfile.in
33                 $(AM_V_GEN) \
34                 sed \
35                 -e "s:\@PACKAGE_VERSION\@:$(PACKAGE_VERSION):" \
36                 -e "s:\@PACKAGE_NAME\@:$(PACKAGE_NAME):" \
37                 -e "s:\@SRC_DIR\@:$(srcdir):g" \
38                 $(srcdir)/$@.in > $@
39
40 apidoc :        Doxyfile
41                 @test -d apidoc || doxygen
42                 @! find Doxyfile $(top_srcdir)/src/ \( -name '*.h' -o -name '*.md' \) -newer apidoc | \
43                         grep -q '' || doxygen && touch apidoc
44
45 cov-reset-common:
46                 @rm -rf $(top_builddir)/coverage
47                 @find $(top_builddir)/src $(top_builddir)/scripts -name "*.gcda" -delete
48
49 if COVERAGE
50 cov-reset: cov-reset-common
51                 @lcov --zerocounters --directory $(top_builddir)
52
53 cov-report:
54                 @mkdir $(top_builddir)/coverage
55                 lcov -c -o $(top_builddir)/coverage/coverage.info -d $(top_builddir) \
56                          --rc lcov_branch_coverage=1
57                 lcov -r $(top_builddir)/coverage/coverage.info '*/tests/*' \
58                          -o $(top_builddir)/coverage/coverage.cleaned.info \
59                          --rc lcov_branch_coverage=1
60                 genhtml --num-spaces 4 --legend --branch-coverage --ignore-errors source \
61                                 -t "$(PACKAGE_STRING)" \
62                                 -o $(top_builddir)/coverage/html \
63                                 -p `readlink -m $(abs_top_srcdir)`/src \
64                                 $(top_builddir)/coverage/coverage.cleaned.info
65                 @echo "Coverage Report at $(top_builddir)/coverage/html" >&2
66
67 coverage:
68                 @$(MAKE) cov-reset
69                 @$(MAKE) check
70                 @$(MAKE) cov-report
71 else
72 coverage:
73                 @echo "reconfigure with --enable-coverage"
74 endif
75
76 clean-local: cov-reset-common
77                 @find $(top_builddir)/src $(top_builddir)/scripts -name "*.gcno" -delete
78                 @rm -rf apidoc
79
80 .PHONY: cov-reset-common cov-reset cov-report coverage apidoc