5fb6ff9e94765cfef91d14c5e166bd41a89bf4e7
[cvc5.git] / Makefile.am
1 include $(top_srcdir)/config/doxygen.am
2
3 AM_CXXFLAGS = -Wall -Wno-unknown-pragmas
4
5 AUTOMAKE_OPTIONS = foreign
6 ACLOCAL_AMFLAGS = -I config
7
8 SUBDIRS = src test contrib
9
10 .PHONY: units systemtests regress regress0 regress1 regress2 regress3
11 systemtests regress regress0 regress1 regress2 regress3: all
12 +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
13 units: all
14 +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
15
16 LCOV = lcov
17 GENHTML = genhtml
18
19 LCOV_EXCLUDES = \
20 "$(CXXTEST)/*" \
21 "/usr/include/*" \
22 "$(abs_top_builddir)/test/*"
23
24 .PHONY: lcov lcov-all lcov18
25 if COVERAGE_ENABLED
26
27 # lcov 1.7 has some bugs that we have to work around (can't do
28 # baseline measurement, merge between different test-names doesn't
29 # work...)
30 lcov: all
31 $(LCOV) -z -d .
32 +$(MAKE) check -C test/unit
33 $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
34 $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
35 mkdir -p "@top_srcdir@/html"
36 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
37 @echo "De-mangling C++ symbols..."
38 @find "@top_srcdir@/html" -name '*.func.html' | \
39 xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
40
41 lcov-all: all
42 $(LCOV) -z -d .
43 +$(MAKE) check -C test
44 $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
45 $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
46 mkdir -p "@top_srcdir@/html"
47 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
48 @echo "De-mangling C++ symbols..."
49 @find "@top_srcdir@/html" -name '*.func.html' | \
50 xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
51
52 # when we get a working lcov, we can do better stats for
53 # modules/test-types; unfortunately lcov 1.8 directory paths
54 # are broken(?) or at least different than 1.7
55 lcov18: all
56 +@for testtype in public black white; do \
57 echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \
58 echo $(LCOV) -z -d .; \
59 $(LCOV) -z -d . || exit 1; \
60 echo $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
61 $(MAKE) check -C test/unit TEST_SUFFIX=_$$testtype || exit 1; \
62 echo $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
63 $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
64 echo $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES); \
65 $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES) || exit 1; \
66 echo; \
67 done
68 mkdir -p "@top_srcdir@/html"
69 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage-public.info cvc4-coverage-black.info cvc4-coverage-white.info
70 @echo "De-mangling C++ symbols..."
71 @find "@top_srcdir@/html" -name '*.func.html' | \
72 xargs perl -ni -e 's,(<td class="coverFn"><a href=".*">)(.*)(</a></td>.*),$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";,e || print'
73
74 else
75
76 lcov lcov-all lcov18:
77 @echo
78 @echo "Coverage is not enabled in this build." >&2
79 @echo "Please run configure with --enable-coverage." >&2
80 @echo
81 @false
82
83 endif
84
85 # abs_srcdir is required here to get this Makefile instead of the
86 # Makefile in the builddir (since $(srcdir) is stripped off of
87 # EXTRA_DIST files)
88 EXTRA_DIST = \
89 Makefile.builds.in \
90 Makefile.subdir \
91 config/build-type \
92 config/mkbuilddir \
93 config/doxygen.cfg \
94 doc/cvc4.1.in \
95 doc/cvc4.5.in \
96 doc/libcvc4.3.in \
97 doc/libcvc4parser.3.in \
98 doc/libcvc4compat.3.in
99 man_MANS = \
100 doc/cvc4.1 \
101 doc/cvc4.5 \
102 doc/libcvc4.3 \
103 doc/libcvc4parser.3 \
104 doc/libcvc4compat.3
105
106 dist-hook:
107 cp -p "$(srcdir)/Makefile" "$(distdir)/Makefile"