bca6ca16ee116494ce4d183ecf85c6846d5ec1d5
[cvc5.git] / src / options / Makefile.am
1 # How options are built:
2 # Step 1: Copy the X_options source file into builddir as X_options.tmp.
3 # X_options.tmp is a .PHONY rule to force this step to always be done.
4 # Step 2: Compare X_options.tmp to X_options.options.
5 # If they are different, overwrite "X_options.options".
6 # This is the file that we use to generate options from.
7 # This is always up to dat with X_options. The change in name is just
8 # to keep Makefile stage more explicit.
9 # Step 3: Generate X_options.sed from X_options.options using mkoptions.
10 # Step 4: Generate X_options.h from X_options.sed
11 # Step 5: Generate X_options.cpp from X_options.sed.
12 # This stage also waits for X_options.h as otherwise it cannot compile.
13 #
14
15 # if coverage is enabled:
16 # COVERAGE_ON = yes from configure.ac
17 # Using an inline conditional function to choose between absolute and
18 # relative paths for options files
19 # lcov does not support relative paths and src/options and src/expr
20 # in particular were breaking it
21 # Building with coverage will cause portability issues in some cases
22
23
24 OPTIONS_SRC_FILES = \
25 arith_options \
26 arrays_options \
27 base_options \
28 booleans_options \
29 builtin_options \
30 bv_options \
31 datatypes_options \
32 decision_options \
33 expr_options \
34 fp_options \
35 idl_options \
36 main_options \
37 parser_options \
38 printer_options \
39 proof_options \
40 prop_options \
41 quantifiers_options \
42 sep_options \
43 sets_options \
44 smt_options \
45 strings_options \
46 theory_options \
47 uf_options
48
49 OPTIONS_TEMPS = \
50 arith_options.tmp \
51 arrays_options.tmp \
52 base_options.tmp \
53 booleans_options.tmp \
54 builtin_options.tmp \
55 bv_options.tmp \
56 datatypes_options.tmp \
57 decision_options.tmp \
58 expr_options.tmp \
59 fp_options.tmp \
60 idl_options.tmp \
61 main_options.tmp \
62 parser_options.tmp \
63 printer_options.tmp \
64 proof_options.tmp \
65 prop_options.tmp \
66 quantifiers_options.tmp \
67 sep_options.tmp \
68 sets_options.tmp \
69 smt_options.tmp \
70 strings_options.tmp \
71 theory_options.tmp \
72 uf_options.tmp
73
74 OPTIONS_OPTIONS_FILES = \
75 arith_options.options \
76 arrays_options.options \
77 base_options.options \
78 booleans_options.options \
79 builtin_options.options \
80 bv_options.options \
81 datatypes_options.options \
82 decision_options.options \
83 expr_options.options \
84 fp_options.options \
85 idl_options.options \
86 main_options.options \
87 parser_options.options \
88 printer_options.options \
89 proof_options.options \
90 prop_options.options \
91 quantifiers_options.options \
92 sep_options.options \
93 sets_options.options \
94 smt_options.options \
95 strings_options.options \
96 theory_options.options \
97 uf_options.options
98
99 OPTIONS_SEDS = \
100 arith_options.sed \
101 arrays_options.sed \
102 base_options.sed \
103 booleans_options.sed \
104 builtin_options.sed \
105 bv_options.sed \
106 datatypes_options.sed \
107 decision_options.sed \
108 expr_options.sed \
109 fp_options.sed \
110 idl_options.sed \
111 main_options.sed \
112 parser_options.sed \
113 printer_options.sed \
114 proof_options.sed \
115 prop_options.sed \
116 quantifiers_options.sed \
117 sep_options.sed \
118 sets_options.sed \
119 smt_options.sed \
120 strings_options.sed \
121 theory_options.sed \
122 uf_options.sed
123
124 OPTIONS_HEADS = \
125 arith_options.h \
126 arrays_options.h \
127 base_options.h \
128 booleans_options.h \
129 builtin_options.h \
130 bv_options.h \
131 datatypes_options.h \
132 decision_options.h \
133 expr_options.h \
134 fp_options.h \
135 idl_options.h \
136 main_options.h \
137 parser_options.h \
138 printer_options.h \
139 proof_options.h \
140 prop_options.h \
141 quantifiers_options.h \
142 sep_options.h \
143 sets_options.h \
144 smt_options.h \
145 strings_options.h \
146 theory_options.h \
147 uf_options.h
148
149 OPTIONS_CPPS = \
150 arith_options.cpp \
151 arrays_options.cpp \
152 base_options.cpp \
153 booleans_options.cpp \
154 builtin_options.cpp \
155 bv_options.cpp \
156 datatypes_options.cpp \
157 decision_options.cpp \
158 expr_options.cpp \
159 fp_options.cpp \
160 idl_options.cpp \
161 main_options.cpp \
162 parser_options.cpp \
163 printer_options.cpp \
164 proof_options.cpp \
165 prop_options.cpp \
166 quantifiers_options.cpp \
167 sep_options.cpp \
168 sets_options.cpp \
169 smt_options.cpp \
170 strings_options.cpp \
171 theory_options.cpp \
172 uf_options.cpp
173
174
175 CPP_TEMPLATE_FILES = \
176 base_options_template.h \
177 base_options_template.cpp \
178 options_holder_template.h \
179 options_template.cpp \
180 options_get_option_template.cpp \
181 options_set_option_template.cpp
182
183 CPP_TEMPLATE_SEDS = \
184 base_options_template.h.sed \
185 base_options_template.cpp.sed \
186 options_holder_template.h.sed \
187 options_template.cpp.sed \
188 options_get_option_template.cpp.sed \
189 options_set_option_template.cpp.sed
190
191
192 DOCUMENTATION_FILES = \
193 ../../doc/cvc4.1 \
194 ../../doc/libcvc4.3 \
195 ../../doc/SmtEngine.3cvc \
196 ../../doc/options.3cvc
197
198 DOCUMENTATION_TEMPLATE_FILES = \
199 ../../doc/cvc4.1_template \
200 ../../doc/libcvc4.3_template \
201 ../../doc/SmtEngine.3cvc_template \
202 ../../doc/options.3cvc_template
203
204 DOCUMENTATION_TEMPLATE_SEDS = \
205 ../../doc/cvc4.1_template.sed \
206 ../../doc/libcvc4.3_template.sed \
207 ../../doc/SmtEngine.3cvc_template.sed \
208 ../../doc/options.3cvc_template.sed
209
210 AM_CPPFLAGS = \
211 -D__BUILDING_CVC4LIB \
212 $(if $(COVERAGE_ON), -I@abs_builddir@/.. -I@abs_srcdir@/../include -I@abs_srcdir@/.., \
213 -I@builddir@/.. -I@srcdir@/../include -I@srcdir@/..)
214 AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)
215
216 noinst_LTLIBRARIES = liboptions.la
217
218 liboptions_la_SOURCES = \
219 arith_heuristic_pivot_rule.cpp \
220 arith_heuristic_pivot_rule.h \
221 arith_propagation_mode.cpp \
222 arith_propagation_mode.h \
223 arith_unate_lemma_mode.cpp \
224 arith_unate_lemma_mode.h \
225 argument_extender_implementation.cpp \
226 argument_extender_implementation.h \
227 argument_extender.h \
228 base_handlers.h \
229 bv_bitblast_mode.cpp \
230 bv_bitblast_mode.h \
231 decision_mode.cpp \
232 decision_mode.h \
233 decision_weight.h \
234 didyoumean.cpp \
235 didyoumean.h \
236 language.cpp \
237 language.h \
238 open_ostream.cpp \
239 open_ostream.h \
240 option_exception.h \
241 options.h \
242 options_handler.cpp \
243 options_handler.h \
244 options_public_functions.cpp \
245 printer_modes.cpp \
246 printer_modes.h \
247 quantifiers_modes.cpp \
248 quantifiers_modes.h \
249 set_language.cpp \
250 set_language.h \
251 simplification_mode.cpp \
252 simplification_mode.h \
253 theoryof_mode.cpp \
254 theoryof_mode.h \
255 ufss_mode.h
256
257
258 nodist_liboptions_la_SOURCES = \
259 options.cpp \
260 options_holder.h \
261 $(OPTIONS_HEADS) \
262 $(OPTIONS_CPPS) \
263 options_get_option.cpp \
264 options_set_option.cpp
265
266
267 BUILT_SOURCES = \
268 $(CPP_TEMPLATE_SEDS) \
269 $(DOCUMENTATION_FILES) \
270 $(DOCUMENTATION_TEMPLATE_SEDS) \
271 $(OPTIONS_CPPS) \
272 $(OPTIONS_HEADS) \
273 $(OPTIONS_OPTIONS_FILES) \
274 $(OPTIONS_SEDS) \
275 options.cpp \
276 options_get_option.cpp \
277 options_set_option.cpp \
278 options_holder.h \
279 summary.sed
280
281
282 CLEANFILES = \
283 $(BUILT_SOURCES) \
284 $(DOCUMENTATION_FILES) \
285 $(OPTIONS_TEMPS)
286
287 EXTRA_DIST = \
288 $(DOCUMENTATION_FILES) \
289 $(OPTIONS_CPPS) \
290 $(OPTIONS_HEADS) \
291 $(OPTIONS_SRC_FILES) \
292 base_options_template.cpp \
293 base_options_template.h \
294 language.i \
295 mkoptions \
296 option_exception.i \
297 options.i \
298 options_get_option_template.cpp \
299 options_holder_template.h \
300 options_set_option_template.cpp \
301 options_template.cpp
302
303
304
305
306
307 # Make sure the implicit rules never mistake a _template.cpp or _template.h file for source file.
308 options_holder_template.h options_template.cpp options_get_option_template.cpp options_set_option_template.cpp base_options_template.h base_options_template.cpp :;
309
310 # Make sure the implicit rules never mistake X_options for the -o file for a
311 # CPP file.
312 arith_options arrays_options base_options booleans_options builtin_options bv_options datatypes_options decision_options expr_options fp_options idl_options main_options parser_options printer_options proof_options prop_options quantifiers_options sep_options sets_options smt_options strings_options theory_options uf_options:;
313
314
315 # These are phony to force them to be made everytime.
316 .PHONY: arith_options.tmp arrays_options.tmp base_options.tmp booleans_options.tmp builtin_options.tmp bv_options.tmp datatypes_options.tmp decision_options.tmp expr_options.tmp fp_options.tmp idl_options.tmp main_options.tmp parser_options.tmp printer_options.tmp proof_options.tmp prop_options.tmp quantifiers_options.tmp sep_options.tmp sets_options.tmp smt_options.tmp strings_options.tmp theory_options.tmp uf_options.tmp
317
318 # Make is happier being listed explictly. Not sure why.
319 arith_options.tmp arrays_options.tmp base_options.tmp booleans_options.tmp builtin_options.tmp bv_options.tmp datatypes_options.tmp decision_options.tmp expr_options.tmp fp_options.tmp idl_options.tmp main_options.tmp parser_options.tmp printer_options.tmp proof_options.tmp prop_options.tmp quantifiers_options.tmp sep_options.tmp sets_options.tmp smt_options.tmp strings_options.tmp theory_options.tmp uf_options.tmp:
320 echo "$@" "$(@:.tmp=)"
321 $(AM_V_GEN)(cp $(if $(COVERAGE_ON), "@abs_srcdir@/$(@:.tmp=)", "@srcdir@/$(@:.tmp=)") "$@" || true)
322 #TIM:
323 #The (... || true) here is to make distcheck not fail.
324
325 %_options.options: %_options.tmp
326 $(AM_V_GEN)\
327 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
328
329
330 # This bit is kinda tricky.
331 # We use the updating of %_options.options to signal that the options file updated.
332 # However, we use the original file in src to generate the file.
333 %_options.sed: %_options.options mkoptions
334 $(AM_V_at)chmod +x @srcdir@/mkoptions
335 $(AM_V_GEN)(@srcdir@/mkoptions module-sed $(if $(COVERAGE_ON), "@abs_srcdir@/$(@:.sed=)", "@srcdir@/$(@:.sed=)")) > "$@"
336
337
338 $(CPP_TEMPLATE_SEDS): %.sed : % mkoptions
339 # echo "template seds"
340 # echo "$@"
341 # echo $(TEMPLATE_SEDS)
342 $(AM_V_at)chmod +x @srcdir@/mkoptions
343 $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
344
345 $(DOCUMENTATION_TEMPLATE_SEDS): %.sed : % mkoptions
346 # echo "template seds"
347 # echo "$@"
348 # echo $(TEMPLATE_SEDS)
349 $(AM_V_at)chmod +x @srcdir@/mkoptions
350 $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
351
352 %_options.h : %_options.sed mkoptions base_options_template.h base_options_template.h.sed
353 # echo heads
354 # echo "$@"
355 # echo $(OPTIONS_HEADS)
356 $(AM_V_at)chmod +x @srcdir@/mkoptions
357 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
358 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/base_options_template.h \
359 base_options_template.h.sed \
360 "$<" \
361 ) > "$@"
362
363 summary.sed : mkoptions $(OPTIONS_OPTIONS_FILES)
364 $(AM_V_at)chmod +x @srcdir@/mkoptions
365 $(AM_V_GEN)(@srcdir@/mkoptions summary-sed \
366 $(OPTIONS_OPTIONS_FILES) \
367 ) > summary.sed
368
369
370
371 # mkoptions apply-sed-to-template sed-file template-file
372 options_holder.h : options_holder_template.h options_holder_template.h.sed summary.sed mkoptions $(OPTIONS_HEADS)
373 $(AM_V_at)chmod +x @srcdir@/mkoptions
374 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
375 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_holder_template.h \
376 @builddir@/options_holder_template.h.sed \
377 summary.sed \
378 ) > "$@"
379
380 # Make sure not to match with "options.cpp" too.
381 %_options.cpp: %_options.sed %_options.h mkoptions options_holder.h base_options_template.cpp base_options_template.cpp.sed
382 $(AM_V_at)chmod +x @srcdir@/mkoptions
383 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
384 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/base_options_template.cpp \
385 base_options_template.cpp.sed \
386 "$<" \
387 ) > "$@"
388
389
390
391
392 # mkoptions apply-sed-to-template sed-file template-file
393 options.cpp : options_template.cpp options_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS) options_holder.h
394 $(AM_V_at)chmod +x @srcdir@/mkoptions
395 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
396 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_template.cpp \
397 @builddir@/options_template.cpp.sed \
398 summary.sed \
399 ) > "$@"
400
401
402 # mkoptions apply-sed-to-template sed-file template-file
403 options_get_option.cpp : options_get_option_template.cpp options_get_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
404 $(AM_V_at)chmod +x @srcdir@/mkoptions
405 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
406 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_get_option_template.cpp \
407 @builddir@/options_get_option_template.cpp.sed \
408 summary.sed \
409 ) > "$@"
410
411 options_set_option.cpp : options_set_option_template.cpp options_set_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
412 $(AM_V_at)chmod +x @srcdir@/mkoptions
413 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
414 $(if $(COVERAGE_ON), @abs_srcdir@, @srcdir@)/options_set_option_template.cpp \
415 @builddir@/options_set_option_template.cpp.sed \
416 summary.sed \
417 ) > "$@"
418
419
420
421 $(DOCUMENTATION_FILES) : % : %_template %_template.sed mkoptions summary.sed
422 # echo "$<"
423 # echo "$@"
424 $(AM_V_at)chmod +x @srcdir@/mkoptions
425 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
426 "$<" \
427 "$<".sed \
428 @builddir@/summary.sed \
429 ) > "$@"
430
431
432
433 #options-stamp: options_holder_template.h options_template.cpp smt_options_template.cpp base_options_template.h base_options_template.cpp mkoptions $(OPTIONS_FILE_SRCS)
434
435
436 # This rule is ugly. It's needed to ensure that automake's dependence
437 # includes are available during distclean, even though they come from
438 # directories that are cleaned first. Without this rule, "distclean"
439 # fails.
440 %.Plo:; $(MKDIR_P) "$(dir $@)" && : > "$@"