e909e1705965c3f20541d4a227ac7805247968de
[cvc5.git] / src / util / Makefile.am
1 AM_CPPFLAGS = \
2 -D__BUILDING_CVC4LIB \
3 -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/..
4 AM_CXXFLAGS = -Wall -Wno-unknown-pragmas $(FLAG_VISIBILITY_HIDDEN)
5
6 noinst_LTLIBRARIES = libutil.la libutilcudd.la
7
8 # libutilcudd.la is a separate library so that we can pass separate
9 # compiler flags
10 libutilcudd_la_CPPFLAGS = $(CPPFLAGS) $(AM_CPPFLAGS) @CUDD_CPPFLAGS@
11 libutilcudd_la_LIBADD = @CUDD_LDFLAGS@ @CUDD_LIBS@
12
13 # Do not list built sources (like integer.h, rational.h, and tls.h) here!
14 # Rather, list them under BUILT_SOURCES, and their .in versions under
15 # EXTRA_DIST. Otherwise, they're packaged up in the tarball, which is
16 # no good---they belong in the configured builds/ directory. If they
17 # end up in the source directory, they build the cvc4 that was
18 # configured at the time of the "make dist", which (1) may not be the
19 # configuration that the user wants, and (2) might cause link errors.
20 libutil_la_SOURCES = \
21 Assert.h \
22 Assert.cpp \
23 backtrackable.h \
24 Makefile.am \
25 Makefile.in \
26 congruence_closure.h \
27 debug.h \
28 exception.h \
29 hash.h \
30 bool.h \
31 options.h \
32 options.cpp \
33 output.cpp \
34 output.h \
35 result.h \
36 result.cpp \
37 configuration.h \
38 configuration_private.h \
39 configuration.cpp \
40 bitvector.h \
41 ascription_type.h \
42 array.h \
43 datatype.h \
44 datatype.cpp \
45 matcher.h \
46 gmp_util.h \
47 sexpr.h \
48 stats.h \
49 stats.cpp \
50 dynamic_array.h \
51 language.h \
52 language.cpp \
53 ntuple.h \
54 recursion_breaker.h \
55 subrange_bound.h \
56 cardinality.h \
57 cardinality.cpp \
58 cache.h \
59 utility.h \
60 trans_closure.h \
61 trans_closure.cpp \
62 boolean_simplification.h \
63 boolean_simplification.cpp \
64 ite_removal.h \
65 ite_removal.cpp \
66 pseudoboolean.h \
67 pseudoboolean.cpp \
68 node_visitor.h
69
70 libutil_la_LIBADD = \
71 @builddir@/libutilcudd.la
72 libutilcudd_la_SOURCES = \
73 propositional_query.h \
74 propositional_query.cpp
75
76 BUILT_SOURCES = \
77 rational.h \
78 integer.h \
79 tls.h
80 if CVC4_DEBUG
81 # listing Debug_tags too ensures that make doesn't auto-remove it
82 # after building (if it does, we don't get the "cached" effect with
83 # the .tmp files below, and we have to re-compile and re-link each
84 # time, even when there are no changes).
85 BUILT_SOURCES += \
86 Debug_tags.h \
87 Debug_tags
88 endif
89 if CVC4_TRACING
90 # listing Trace_tags too ensures that make doesn't auto-remove it
91 # after building (if it does, we don't get the "cached" effect with
92 # the .tmp files below, and we have to re-compile and re-link each
93 # time, even when there are no changes).
94 BUILT_SOURCES += \
95 Trace_tags.h \
96 Trace_tags
97 endif
98
99 %_tags.h: %_tags
100 $(AM_V_GEN)( \
101 echo 'static char const* const $^[] = {'; \
102 for tag in `cat $^`; do \
103 echo "\"$$tag\","; \
104 done; \
105 echo 'NULL'; \
106 echo '};' \
107 ) >"$@"
108
109 # This .tmp business is to keep from having to re-compile options.cpp
110 # (and then re-link the libraries) if nothing has changed.
111 %_tags: %_tags.tmp
112 $(AM_V_GEN)\
113 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
114 # .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
115 .PHONY: Debug_tags.tmp Trace_tags.tmp
116 # The "sed" invocation below is particularly obnoxious, but it works around
117 # inconsistencies in REs on different platforms, using only a basic regular
118 # expression (no |, no \<, ...).
119 Debug_tags.tmp Trace_tags.tmp:
120 $(AM_V_GEN)\
121 grep '\<$(@:_tags.tmp=) *( *\".*\" *)' \
122 `find @srcdir@/../ -name "*.cpp" -or -name "*.h" -or -name "*.cc" -or -name "*.g"` | \
123 sed 's/^$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/;s/.*[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/' | sort | uniq >"$@"
124
125 if CVC4_CLN_IMP
126 libutil_la_SOURCES += \
127 rational_cln_imp.cpp
128 endif
129 if CVC4_GMP_IMP
130 libutil_la_SOURCES += \
131 rational_gmp_imp.cpp
132 endif
133
134 EXTRA_DIST = \
135 rational_cln_imp.h \
136 integer_cln_imp.h \
137 rational_cln_imp.cpp \
138 rational_gmp_imp.h \
139 integer_gmp_imp.h \
140 rational_gmp_imp.cpp \
141 rational.h.in \
142 integer.h.in \
143 tls.h.in \
144 integer.i \
145 stats.i \
146 bool.i \
147 sexpr.i \
148 datatype.i \
149 output.i \
150 cardinality.i \
151 result.i \
152 configuration.i \
153 Assert.i \
154 bitvector.i \
155 subrange_bound.i \
156 exception.i \
157 language.i \
158 array.i \
159 options.i \
160 ascription_type.i \
161 rational.i \
162 pseudoboolean.i \
163 hash.i