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.
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
53 booleans_options.tmp \
56 datatypes_options.tmp \
57 decision_options.tmp \
66 quantifiers_options.tmp \
74 OPTIONS_OPTIONS_FILES = \
75 arith_options.options \
76 arrays_options.options \
77 base_options.options \
78 booleans_options.options \
79 builtin_options.options \
81 datatypes_options.options \
82 decision_options.options \
83 expr_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 \
93 sets_options.options \
95 strings_options.options \
96 theory_options.options \
103 booleans_options.sed \
104 builtin_options.sed \
106 datatypes_options.sed \
107 decision_options.sed \
113 printer_options.sed \
116 quantifiers_options.sed \
120 strings_options.sed \
131 datatypes_options.h \
141 quantifiers_options.h \
153 booleans_options.cpp \
154 builtin_options.cpp \
156 datatypes_options.cpp \
157 decision_options.cpp \
163 printer_options.cpp \
166 quantifiers_options.cpp \
170 strings_options.cpp \
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
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
192 DOCUMENTATION_FILES = \
194 ../../doc/libcvc4.3 \
195 ../../doc/SmtEngine.3cvc \
196 ../../doc/options.3cvc
198 DOCUMENTATION_TEMPLATE_FILES = \
199 ../../doc/cvc4.1_template \
200 ../../doc/libcvc4.3_template \
201 ../../doc/SmtEngine.3cvc_template \
202 ../../doc/options.3cvc_template
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
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)
216 noinst_LTLIBRARIES = liboptions.la
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 \
229 bv_bitblast_mode.cpp \
242 options_handler.cpp \
244 options_public_functions.cpp \
247 quantifiers_modes.cpp \
248 quantifiers_modes.h \
251 simplification_mode.cpp \
252 simplification_mode.h \
258 nodist_liboptions_la_SOURCES = \
263 options_get_option.cpp \
264 options_set_option.cpp
268 $(CPP_TEMPLATE_SEDS) \
269 $(DOCUMENTATION_FILES) \
270 $(DOCUMENTATION_TEMPLATE_SEDS) \
273 $(OPTIONS_OPTIONS_FILES) \
276 options_get_option.cpp \
277 options_set_option.cpp \
284 $(DOCUMENTATION_FILES) \
288 $(DOCUMENTATION_FILES) \
291 $(OPTIONS_SRC_FILES) \
292 base_options_template.cpp \
293 base_options_template.h \
298 options_get_option_template.cpp \
299 options_holder_template.h \
300 options_set_option_template.cpp \
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 :;
310 # Make sure the implicit rules never mistake X_options for the -o file for a
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:;
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
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)
323 #The (... || true) here is to make distcheck not fail.
325 %_options.options: %_options.tmp
327 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
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=)")) > "$@"
338 $(CPP_TEMPLATE_SEDS): %.sed : % mkoptions
339 # echo "template seds"
341 # echo $(TEMPLATE_SEDS)
342 $(AM_V_at)chmod +x @srcdir@/mkoptions
343 $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
345 $(DOCUMENTATION_TEMPLATE_SEDS): %.sed : % mkoptions
346 # echo "template seds"
348 # echo $(TEMPLATE_SEDS)
349 $(AM_V_at)chmod +x @srcdir@/mkoptions
350 $(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"
352 %_options.h : %_options.sed mkoptions base_options_template.h base_options_template.h.sed
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 \
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) \
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 \
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 \
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 \
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 \
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 \
421 $(DOCUMENTATION_FILES) : % : %_template %_template.sed mkoptions summary.sed
424 $(AM_V_at)chmod +x @srcdir@/mkoptions
425 $(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
428 @builddir@/summary.sed \
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)
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"
440 %.Plo:; $(MKDIR_P) "$(dir $@)" && : > "$@"