906a64a652acccc1d42deb5b1a90b5cbb62ed721
[cvc5.git] / src / Makefile.am
1 # LIBCVC4_VERSION (-version-info) is in the form current:revision:age
2 #
3 # current -
4 # increment if interfaces have been added, removed or changed
5 # revision -
6 # increment if source code has changed
7 # set to zero if current is incremented
8 # age -
9 # increment if interfaces have been added
10 # set to zero if interfaces have been removed
11 # or changed
12 #
13 LIBCVC4_VERSION = @CVC4_LIBRARY_VERSION@
14
15 AM_CPPFLAGS = \
16 -D__BUILDING_CVC4LIB \
17 -I@srcdir@/include -I@srcdir@ -I@builddir@
18 AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN)
19
20 SUBDIRS = lib expr util context theory prop smt printer proof . parser compat bindings main
21
22 lib_LTLIBRARIES = libcvc4.la
23 if HAVE_CXXTESTGEN
24 check_LTLIBRARIES = libcvc4_noinst.la
25 endif
26
27 libcvc4_la_LDFLAGS = -version-info $(LIBCVC4_VERSION)
28
29 # This "tricks" automake into linking us as a C++ library (rather than
30 # as a C library, which messes up exception handling support)
31 nodist_EXTRA_libcvc4_noinst_la_SOURCES = dummy.cpp
32 nodist_EXTRA_libcvc4_la_SOURCES = dummy.cpp
33 libcvc4_noinst_la_SOURCES = subversion_versioninfo.cpp
34 libcvc4_la_SOURCES = subversion_versioninfo.cpp
35 libcvc4_la_LIBADD = \
36 @builddir@/util/libutil.la \
37 @builddir@/expr/libexpr.la \
38 @builddir@/context/libcontext.la \
39 @builddir@/proof/libproof.la \
40 @builddir@/prop/libprop.la \
41 @builddir@/prop/minisat/libminisat.la \
42 @builddir@/printer/libprinter.la \
43 @builddir@/smt/libsmt.la \
44 @builddir@/theory/libtheory.la \
45 @builddir@/lib/libreplacements.la
46 libcvc4_noinst_la_LIBADD = \
47 @builddir@/util/libutil.la \
48 @builddir@/expr/libexpr.la \
49 @builddir@/context/libcontext.la \
50 @builddir@/proof/libproof.la \
51 @builddir@/prop/libprop.la \
52 @builddir@/prop/minisat/libminisat.la \
53 @builddir@/printer/libprinter.la \
54 @builddir@/smt/libsmt.la \
55 @builddir@/theory/libtheory.la \
56 @builddir@/lib/libreplacements.la
57
58 CLEANFILES = \
59 subversion_versioninfo.cpp \
60 svninfo.tmp \
61 svninfo
62
63 EXTRA_DIST = \
64 include/cvc4parser_private.h \
65 include/cvc4parser_public.h \
66 include/cvc4_private.h \
67 include/cvc4_public.h \
68 include/cvc4.h \
69 cvc4.i
70
71 subversion_versioninfo.cpp: svninfo
72 $(AM_V_GEN)( \
73 if test -s svninfo; then \
74 issvn=true; \
75 branch=`grep '^URL: ' svninfo | sed 's,.*/cvc4/,,'`; \
76 rev=`grep '^Revision: ' svninfo | awk '{print$$2}'`; \
77 mods=`grep '^Modifications: ' svninfo | awk '{print$$2}'`; \
78 else \
79 issvn=false; \
80 branch=unknown; \
81 rev=0; \
82 mods=false; \
83 fi; \
84 echo "#include \"util/configuration.h\""; \
85 echo "const bool ::CVC4::Configuration::IS_SUBVERSION_BUILD = $$issvn;"; \
86 echo "const char* const ::CVC4::Configuration::SUBVERSION_BRANCH_NAME = \"$$branch\";"; \
87 echo "const unsigned ::CVC4::Configuration::SUBVERSION_REVISION = $$rev;"; \
88 echo "const bool ::CVC4::Configuration::SUBVERSION_HAS_MODIFICATIONS = $$mods;"; \
89 ) >"$@"
90 # This .tmp business is to keep from having to re-compile options.cpp
91 # (and then re-link the libraries) if nothing has changed.
92 svninfo: svninfo.tmp
93 $(AM_V_GEN)diff -q svninfo.tmp svninfo &>/dev/null || mv svninfo.tmp svninfo || true
94 # .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
95 .PHONY: svninfo.tmp
96 svninfo.tmp:
97 $(AM_V_GEN)(cd "$(top_srcdir)" && svn info && echo "Modifications: `test -z \"\`svn status -q\`\" && echo false || echo true`") >"$@" 2>/dev/null || true
98
99 install-data-local:
100 (echo include/cvc4.h; \
101 echo include/cvc4_public.h; \
102 find * -name '*.h' | \
103 xargs grep -l '^# *include *"cvc4.*_public\.h"'; \
104 (cd "$(srcdir)" && find * -name '*.h' | \
105 xargs grep -l '^# *include *"cvc4.*_public\.h"')) | \
106 while read f; do \
107 if expr "$$f" : ".*_\(template\|private\|test_utils\)\.h$$" &>/dev/null; then \
108 continue; \
109 fi; \
110 d="$$(echo "$$f" | sed 's,^include/,,')"; \
111 $(mkinstalldirs) "$$(dirname "$(DESTDIR)$(includedir)/cvc4/$$d")"; \
112 if [ -e "$$f" ]; then \
113 path="$$f"; \
114 else \
115 path="$(srcdir)/$$f"; \
116 fi; \
117 echo $(INSTALL_DATA) "$$path" "$(DESTDIR)$(includedir)/cvc4/$$d"; \
118 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(includedir)/cvc4/$$d"; \
119 done
120
121 uninstall-local:
122 -(echo include/cvc4.h; \
123 echo include/cvc4_public.h; \
124 find * -name '*.h' | \
125 xargs grep -l '^# *include *"cvc4.*_public\.h"'; \
126 (cd "$(srcdir)" && find * -name '*.h' | \
127 xargs grep -l '^# *include *"cvc4.*_public\.h"')) | \
128 while read f; do \
129 if expr "$$f" : ".*_\(template\|private\|test_utils\)\.h$$" &>/dev/null; then \
130 continue; \
131 fi; \
132 d="$$(echo "$$f" | sed 's,^include/,,')"; \
133 rm -f "$(DESTDIR)$(includedir)/cvc4/$$d"; \
134 rmdir -p "$$(dirname "$(DESTDIR)$(includedir)/cvc4/$$d")" 2>/dev/null; \
135 done
136 -rmdir "$(DESTDIR)$(includedir)/cvc4"