Move some regress benchmarks around that took too long, other test cleanup.
[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 DIST_SUBDIRS = $(SUBDIRS) examples
10
11 .PHONY: examples
12 examples: all
13 (cd examples && $(MAKE) $(AM_MAKEFLAGS))
14
15 .PHONY: install-examples
16 install-examples:
17 (cd examples && $(MAKE) $(AM_MAKEFLAGS) install-data)
18
19 .PHONY: units systemtests regress regress0 regress1 regress2 regress3
20 systemtests regress regress0 regress1 regress2 regress3: all
21 +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
22 # We descend into "src" with the "check" target here to ensure that
23 # the test prerequisites are all built.
24 units:
25 (cd src && $(MAKE) $(AM_MAKEFLAGS) check)
26 +(cd test && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
27
28 LCOV = lcov
29 GENHTML = genhtml
30
31 LCOV_EXCLUDES = \
32 "$(CXXTEST)/*" \
33 "/usr/include/*" \
34 "$(abs_top_builddir)/test/*"
35
36 .PHONY: lcov lcov-all lcov18
37 if COVERAGE_ENABLED
38
39 # lcov 1.7 has some bugs that we have to work around (can't do
40 # baseline measurement, merge between different test-names doesn't
41 # work...)
42 lcov: all
43 $(LCOV) -z -d .
44 (cd src && $(MAKE) $(AM_MAKEFLAGS) check)
45 +(cd test/unit && $(MAKE) $(AM_MAKEFLAGS) check)
46 $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
47 $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
48 mkdir -p "@top_srcdir@/html"
49 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
50 @echo "De-mangling C++ symbols..."
51 @find "@top_srcdir@/html" -name '*.func.html' | \
52 xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
53
54 lcov-all: all
55 $(LCOV) -z -d .
56 (cd src && $(MAKE) $(AM_MAKEFLAGS) check)
57 +(cd test && $(MAKE) $(AM_MAKEFLAGS) check)
58 $(LCOV) -c -d . -t cvc4_units -o cvc4-coverage-full.info
59 $(LCOV) -o cvc4-coverage.info -r cvc4-coverage-full.info $(LCOV_EXCLUDES)
60 mkdir -p "@top_srcdir@/html"
61 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage.info
62 @echo "De-mangling C++ symbols..."
63 @find "@top_srcdir@/html" -name '*.func.html' | \
64 xargs perl -pi -e 's#(<td class="coverFn"><a href=".*">)(.*)(</a></td>)#$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";#e'
65
66 # when we get a working lcov, we can do better stats for
67 # modules/test-types; unfortunately lcov 1.8 directory paths
68 # are broken(?) or at least different than 1.7
69 lcov18: all
70 +@for testtype in public black white; do \
71 echo; echo "=== Collecting coverage data from $$testtype unit tests ==="; \
72 echo $(LCOV) -z -d .; \
73 $(LCOV) -z -d . || exit 1; \
74 echo "(cd src && $(MAKE) $(AM_MAKEFLAGS) check) || exit 1"; \
75 (cd src && $(MAKE) $(AM_MAKEFLAGS) check) || exit 1; \
76 echo "(cd test/unit && $(MAKE) $(AM_MAKEFLAGS) check TEST_SUFFIX=_$$testtype) || exit 1"; \
77 (cd test/unit && $(MAKE) $(AM_MAKEFLAGS) check TEST_SUFFIX=_$$testtype) || exit 1; \
78 echo $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
79 $(LCOV) -c -d . -t $$testtype -o cvc4-coverage-$$testtype-full.info || exit 1; \
80 echo $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES); \
81 $(LCOV) -o cvc4-coverage-$$testtype.info -r cvc4-coverage-$$testtype-full.info $(LCOV_EXCLUDES) || exit 1; \
82 echo; \
83 done
84 mkdir -p "@top_srcdir@/html"
85 $(GENHTML) -o "@top_srcdir@/html" cvc4-coverage-public.info cvc4-coverage-black.info cvc4-coverage-white.info
86 @echo "De-mangling C++ symbols..."
87 @find "@top_srcdir@/html" -name '*.func.html' | \
88 xargs perl -ni -e 's,(<td class="coverFn"><a href=".*">)(.*)(</a></td>.*),$$_=`c++filt "$$2"`;chomp;print "$$1<xmp>$$_</xmp>$$3\n";,e || print'
89
90 else
91
92 lcov lcov-all lcov18:
93 @echo
94 @echo "Coverage is not enabled in this build." >&2
95 @echo "Please run configure with --enable-coverage." >&2
96 @echo
97 @false
98
99 endif
100
101 # abs_srcdir is required here to get this Makefile instead of the
102 # Makefile in the builddir (since $(srcdir) is stripped off of
103 # EXTRA_DIST files)
104 EXTRA_DIST = \
105 Makefile.builds.in \
106 Makefile.subdir \
107 library_versions \
108 RELEASE-NOTES \
109 config/build-type \
110 config/mkbuilddir \
111 config/doxygen.cfg \
112 doc/find_public_interface.sh \
113 doc/cvc4.1_template.in \
114 doc/cvc4.5.in \
115 doc/libcvc4.3_template.in \
116 doc/SmtEngine.3cvc_template.in \
117 doc/options.3cvc_template.in \
118 doc/libcvc4parser.3.in \
119 doc/libcvc4compat.3.in
120 man_MANS = \
121 doc/cvc4.1 \
122 doc/pcvc4.1 \
123 doc/cvc4.5 \
124 doc/libcvc4.3 \
125 doc/SmtEngine.3cvc \
126 doc/options.3cvc \
127 doc/libcvc4parser.3 \
128 doc/libcvc4compat.3
129
130 doc/pcvc4.1: doc/cvc4.1
131 rm -f doc/pcvc4.1
132 cp -p "$<" "$@"
133
134 # Can't put the first several in EXTRA_DIST because those are processed
135 # *before* recursive "make dist", and these files are generated in a
136 # subdirectory invocation of "make dist".
137 #
138 # The Makefile also can't go in EXTRA_DIST, because then automake thinks
139 # it's the one in the builddir and we want the one from the srcdir.
140 dist-hook: doc/cvc4.1 doc/libcvc4.3 doc/SmtEngine.3cvc doc/options.3cvc
141 cp -p $^ "$(distdir)/doc"
142 cp -p "$(srcdir)/Makefile" "$(distdir)/Makefile"
143
144 distclean-local:
145 test -z "$(DX_DOCDIR)" || rm -fr "$(DX_DOCDIR)"
146
147 # these have .in versions
148 DISTCLEANFILES = \
149 doc/cvc4.1 \
150 doc/cvc4.1_template \
151 doc/pcvc4.1 \
152 doc/cvc4.5 \
153 doc/libcvc4.3 \
154 doc/libcvc4.3_template \
155 doc/libcvc4compat.3 \
156 doc/libcvc4parser.3 \
157 doc/SmtEngine.3cvc \
158 doc/SmtEngine.3cvc_template \
159 doc/options.3cvc \
160 doc/options.3cvc_template