fix some build dependencies in options-building; should fix a strange bug Andy saw...
[cvc5.git] / src / options / Makefile.am
1 OPTIONS_FILES_SRCS = \
2 base_options.cpp \
3 base_options.h \
4 ../expr/options.cpp \
5 ../expr/options.h \
6 ../theory/booleans/options.cpp \
7 ../theory/booleans/options.h \
8 ../theory/options.cpp \
9 ../theory/options.h \
10 ../theory/bv/options.cpp \
11 ../theory/bv/options.h \
12 ../theory/datatypes/options.cpp \
13 ../theory/datatypes/options.h \
14 ../theory/builtin/options.cpp \
15 ../theory/builtin/options.h \
16 ../theory/arith/options.cpp \
17 ../theory/arith/options.h \
18 ../theory/uf/options.cpp \
19 ../theory/uf/options.h \
20 ../theory/arrays/options.cpp \
21 ../theory/arrays/options.h \
22 ../theory/quantifiers/options.cpp \
23 ../theory/quantifiers/options.h \
24 ../theory/rewriterules/options.cpp \
25 ../theory/rewriterules/options.h \
26 ../prop/options.cpp \
27 ../prop/options.h \
28 ../proof/options.cpp \
29 ../proof/options.h \
30 ../printer/options.cpp \
31 ../printer/options.h \
32 ../smt/options.cpp \
33 ../smt/options.h \
34 ../decision/options.cpp \
35 ../decision/options.h \
36 ../main/options.cpp \
37 ../main/options.h \
38 ../parser/options.cpp \
39 ../parser/options.h
40
41 OPTIONS_FILES = \
42 $(patsubst %.cpp,%,$(filter %.cpp,$(OPTIONS_FILES_SRCS)))
43
44 AM_CPPFLAGS = \
45 -D__BUILDING_CVC4LIB \
46 -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/..
47 AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)
48
49 noinst_LTLIBRARIES = liboptions.la
50
51 liboptions_la_SOURCES = \
52 options.h \
53 base_options_handlers.h \
54 option_exception.h
55
56 nodist_liboptions_la_SOURCES = \
57 options.cpp \
58 options_holder.h \
59 base_options.cpp \
60 base_options.h \
61 ../expr/options.cpp \
62 ../expr/options.h \
63 ../theory/booleans/options.cpp \
64 ../theory/booleans/options.h \
65 ../theory/options.cpp \
66 ../theory/options.h \
67 ../theory/bv/options.cpp \
68 ../theory/bv/options.h \
69 ../theory/datatypes/options.cpp \
70 ../theory/datatypes/options.h \
71 ../theory/builtin/options.cpp \
72 ../theory/builtin/options.h \
73 ../theory/arith/options.cpp \
74 ../theory/arith/options.h \
75 ../theory/uf/options.cpp \
76 ../theory/uf/options.h \
77 ../theory/arrays/options.cpp \
78 ../theory/arrays/options.h \
79 ../theory/quantifiers/options.cpp \
80 ../theory/quantifiers/options.h \
81 ../theory/rewriterules/options.cpp \
82 ../theory/rewriterules/options.h \
83 ../prop/options.cpp \
84 ../prop/options.h \
85 ../proof/options.cpp \
86 ../proof/options.h \
87 ../printer/options.cpp \
88 ../printer/options.h \
89 ../smt/options.cpp \
90 ../smt/options.h \
91 ../decision/options.cpp \
92 ../decision/options.h \
93 ../main/options.cpp \
94 ../main/options.h \
95 ../parser/options.cpp \
96 ../parser/options.h
97
98 BUILT_SOURCES = \
99 exprs-builts \
100 ../smt/smt_options.cpp \
101 options.cpp \
102 options_holder.h
103
104 DISTCLEANFILES = \
105 $(OPTIONS_FILES_SRCS) \
106 $(BUILT_SOURCES) \
107 options-stamp
108
109 EXTRA_DIST = \
110 mkoptions \
111 base_options_template.h \
112 base_options_template.cpp \
113 options_template.cpp \
114 options_holder_template.h \
115 options.i \
116 option_exception.i \
117 $(OPTIONS_FILES)
118
119 if CVC4_DEBUG
120 # listing Debug_tags too ensures that make doesn't auto-remove it
121 # after building (if it does, we don't get the "cached" effect with
122 # the .tmp files below, and we have to re-compile and re-link each
123 # time, even when there are no changes).
124 BUILT_SOURCES += \
125 Debug_tags.h \
126 Debug_tags
127 endif
128 if CVC4_TRACING
129 # listing Trace_tags too ensures that make doesn't auto-remove it
130 # after building (if it does, we don't get the "cached" effect with
131 # the .tmp files below, and we have to re-compile and re-link each
132 # time, even when there are no changes).
133 BUILT_SOURCES += \
134 Trace_tags.h \
135 Trace_tags
136 endif
137 %_tags.h: %_tags
138 $(AM_V_GEN)( \
139 echo 'static char const* const $^[] = {'; \
140 for tag in `cat $^`; do \
141 echo "\"$$tag\","; \
142 done; \
143 echo 'NULL'; \
144 echo '};' \
145 ) >"$@"
146
147 # This .tmp business is to keep from having to re-compile options.cpp
148 # (and then re-link the libraries) if nothing has changed.
149 %_tags: %_tags.tmp
150 $(AM_V_GEN)\
151 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
152 # .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
153 .PHONY: Debug_tags.tmp Trace_tags.tmp
154 # The "sed" invocation below is particularly obnoxious, but it works around
155 # inconsistencies in REs on different platforms, using only a basic regular
156 # expression (no |, no \<, ...).
157 Debug_tags.tmp Trace_tags.tmp:
158 $(AM_V_GEN)\
159 grep '\<$(@:_tags.tmp=) *( *\".*\" *)' \
160 `find @srcdir@/../ -name "*.cpp" -or -name "*.h" -or -name "*.cc" -or -name "*.g"` | \
161 sed 's/^$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/;s/.*[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/' | sort | uniq >"$@"
162
163 MOSTLYCLEANFILES = \
164 Debug_tags \
165 Trace_tags \
166 Debug_tags.tmp \
167 Trace_tags.tmp \
168 Debug_tags.h \
169 Trace_tags.h
170
171 options_holder.h options.cpp ../smt/smt_options.cpp $(OPTIONS_FILES_SRCS): options-stamp
172 options-stamp: options_holder_template.h options_template.cpp ../smt/smt_options_template.cpp base_options_template.h base_options_template.cpp mkoptions $(OPTIONS_FILES)
173 $(AM_V_at)chmod +x @srcdir@/mkoptions
174 $(AM_V_GEN)(@srcdir@/mkoptions \
175 @srcdir@/options_holder_template.h @builddir@/options_holder.h \
176 @srcdir@/options_template.cpp @builddir@/options.cpp \
177 @srcdir@/../smt/smt_options_template.cpp @builddir@/../smt/smt_options.cpp \
178 @top_builddir@/doc/cvc4.1_template @top_builddir@/doc/cvc4.1 \
179 -t \
180 @srcdir@/base_options_template.h @srcdir@/base_options_template.cpp \
181 $(foreach o,$(OPTIONS_FILES),"$(srcdir)/$(o)" "$(dir $(builddir)/$(o))") \
182 )
183 touch "$@"
184
185 $(OPTIONS_FILES):;
186
187 .PHONY: exprs-builts
188 exprs-builts:; $(AM_V_at)[ "$(FROM_EXPR)" != 1 ] && $(MAKE) -C ../expr builts || true