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