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