summaryrefslogtreecommitdiff
path: root/src/options/Makefile.am
blob: d871bfb0a44d0e0ca9b934139f4afbe5010ddcfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# How options are built:
# Step 1: Copy the X_options source file into builddir as X_options.tmp.
#    X_options.tmp is a .PHONY rule to force this step to always be done.
# Step 2: Compare X_options.tmp to X_options.options.
#   If they are different, overwrite "X_options.options".
#   This is the file that we use to generate options from.
#   This is always up to dat with X_options. The change in name is just
#   to keep Makefile stage more explicit.
# Step 3: Generate X_options.sed from X_options.options using mkoptions.
# Step 4: Generate X_options.h from X_options.sed
# Step 5: Generate X_options.cpp from X_options.sed.
#   This stage also waits for X_options.h as otherwise it cannot compile.
# 

OPTIONS_SRC_FILES = \
	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 \
	sets_options \
	smt_options \
	strings_options \
	theory_options \
	uf_options

OPTIONS_TEMPS = \
	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 \
	sets_options.tmp \
	smt_options.tmp \
	strings_options.tmp \
	theory_options.tmp \
	uf_options.tmp

OPTIONS_OPTIONS_FILES = \
	arith_options.options \
	arrays_options.options \
	base_options.options \
	booleans_options.options \
	builtin_options.options \
	bv_options.options \
	datatypes_options.options \
	decision_options.options \
	expr_options.options \
	fp_options.options \
	idl_options.options \
	main_options.options \
	parser_options.options \
	printer_options.options \
	proof_options.options \
	prop_options.options \
	quantifiers_options.options \
	sets_options.options \
	smt_options.options \
	strings_options.options \
	theory_options.options \
	uf_options.options

OPTIONS_SEDS = \
	arith_options.sed \
	arrays_options.sed \
	base_options.sed \
	booleans_options.sed \
	builtin_options.sed \
	bv_options.sed \
	datatypes_options.sed \
	decision_options.sed \
	expr_options.sed \
	fp_options.sed \
	idl_options.sed \
	main_options.sed \
	parser_options.sed \
	printer_options.sed \
	proof_options.sed \
	prop_options.sed \
	quantifiers_options.sed \
	sets_options.sed \
	smt_options.sed \
	strings_options.sed \
	theory_options.sed \
	uf_options.sed

OPTIONS_HEADS = \
	arith_options.h \
	arrays_options.h \
	base_options.h \
	booleans_options.h \
	builtin_options.h \
	bv_options.h \
	datatypes_options.h \
	decision_options.h \
	expr_options.h \
	fp_options.h \
	idl_options.h \
	main_options.h \
	parser_options.h \
	printer_options.h \
	proof_options.h \
	prop_options.h \
	quantifiers_options.h \
	sets_options.h \
	smt_options.h \
	strings_options.h \
	theory_options.h \
	uf_options.h

OPTIONS_CPPS = \
	arith_options.cpp \
	arrays_options.cpp \
	base_options.cpp \
	booleans_options.cpp \
	builtin_options.cpp \
	bv_options.cpp \
	datatypes_options.cpp \
	decision_options.cpp \
	expr_options.cpp \
	fp_options.cpp \
	idl_options.cpp \
	main_options.cpp \
	parser_options.cpp \
	printer_options.cpp \
	proof_options.cpp \
	prop_options.cpp \
	quantifiers_options.cpp \
	sets_options.cpp \
	smt_options.cpp \
	strings_options.cpp \
	theory_options.cpp \
	uf_options.cpp


CPP_TEMPLATE_FILES = \
	base_options_template.h \
	base_options_template.cpp \
	options_holder_template.h \
	options_template.cpp \
	options_handler_get_option_template.cpp \
	options_handler_set_option_template.cpp

CPP_TEMPLATE_SEDS = \
	base_options_template.h.sed \
	base_options_template.cpp.sed \
	options_holder_template.h.sed \
	options_template.cpp.sed \
	options_handler_get_option_template.cpp.sed \
	options_handler_set_option_template.cpp.sed


DOCUMENTATION_FILES = \
	../../doc/cvc4.1 \
	../../doc/libcvc4.3 \
	../../doc/SmtEngine.3cvc \
	../../doc/options.3cvc

DOCUMENTATION_TEMPLATE_FILES = \
	../../doc/cvc4.1_template \
	../../doc/libcvc4.3_template \
	../../doc/SmtEngine.3cvc_template \
	../../doc/options.3cvc_template

DOCUMENTATION_TEMPLATE_SEDS = \
	../../doc/cvc4.1_template.sed \
	../../doc/libcvc4.3_template.sed \
	../../doc/SmtEngine.3cvc_template.sed \
	../../doc/options.3cvc_template.sed

AM_CPPFLAGS = \
	-D__BUILDING_CVC4LIB \
	-I@builddir@/.. -I@srcdir@/../include -I@srcdir@/..
AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)

noinst_LTLIBRARIES = liboptions.la

liboptions_la_SOURCES = \
	arith_heuristic_pivot_rule.cpp \
	arith_heuristic_pivot_rule.h \
	arith_propagation_mode.cpp \
	arith_propagation_mode.h \
	arith_unate_lemma_mode.cpp \
	arith_unate_lemma_mode.h \
	base_handlers.h \
	boolean_term_conversion_mode.cpp \
	boolean_term_conversion_mode.h \
	bv_bitblast_mode.cpp \
	bv_bitblast_mode.h \
	decision_mode.cpp \
	decision_mode.h \
	decision_weight.h \
	didyoumean.cpp \
	didyoumean.h \
	language.cpp \
	language.h \
	logic_info_forward.h \
	option_exception.h \
	options.h \
	options_handler_interface.cpp \
	options_handler_interface.h \
	printer_modes.cpp \
	printer_modes.h \
	quantifiers_modes.cpp \
	quantifiers_modes.h \
	simplification_mode.cpp \
	simplification_mode.h \
	theoryof_mode.cpp \
	theoryof_mode.h \
	ufss_mode.h


nodist_liboptions_la_SOURCES = \
	options.cpp \
	options_holder.h \
	$(OPTIONS_HEADS) \
	$(OPTIONS_CPPS) \
	options_handler_get_option.cpp \
	options_handler_set_option.cpp


BUILT_SOURCES = \
	$(CPP_TEMPLATE_SEDS) \
	$(DOCUMENTATION_FILES) \
	$(DOCUMENTATION_TEMPLATE_SEDS) \
	$(OPTIONS_CPPS) \
	$(OPTIONS_HEADS) \
	$(OPTIONS_OPTIONS_FILES) \
	$(OPTIONS_SEDS) \
	options.cpp \
	options_handler_get_option.cpp \
	options_handler_set_option.cpp \
	options_holder.h \
	summary.sed

# listing {Debug,Trace}_tags too ensures that make doesn't auto-remove it
# after building (if it does, we don't get the "cached" effect with
# the .tmp files below, and we have to re-compile and re-link each
# time, even when there are no changes).
BUILT_SOURCES += \
	Debug_tags.h \
	Debug_tags \
	Trace_tags.h \
	Trace_tags

CLEANFILES = \
	$(BUILT_SOURCES) \
	$(DOCUMENTATION_FILES) \
	$(OPTIONS_TEMPS)

EXTRA_DIST = \
	$(DOCUMENTATION_FILES) \
	$(OPTIONS_CPPS) \
	$(OPTIONS_HEADS) \
	$(OPTIONS_SRC_FILES) \
	base_options_template.cpp \
	base_options_template.h \
	language.i \
	mkoptions \
	mktagheaders \
	mktags \
	option_exception.i \
	options.i \
	options_handler_get_option_template.cpp \
	options_handler_interface.i \
	options_handler_set_option_template.cpp \
	options_holder_template.h \
	options_template.cpp


%_tags.h: %_tags mktagheaders
	$(AM_V_at)chmod +x @srcdir@/mktagheaders
	$(AM_V_GEN)( @srcdir@/mktagheaders "$<" "$<" ) >"$@"

# This .tmp business is to keep from having to re-compile options.cpp
# (and then re-link the libraries) if nothing has changed.
%_tags: %_tags.tmp
	$(AM_V_GEN)\
	diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
# .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
.PHONY: Debug_tags.tmp Trace_tags.tmp
# The "sed" invocation below is particularly obnoxious, but it works around
# inconsistencies in REs on different platforms, using only a basic regular
# expression (no |, no \<, ...).
Debug_tags.tmp Trace_tags.tmp: mktags
	$(AM_V_at)chmod +x @srcdir@/mktags
	$(AM_V_GEN)(@srcdir@/mktags \
    '$(@:_tags.tmp=)' \
    "$$(find @srcdir@/../ -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.g')") >"$@"

MOSTLYCLEANFILES = \
	Debug_tags \
	Trace_tags \
	Debug_tags.tmp \
	Trace_tags.tmp \
	Debug_tags.h \
	Trace_tags.h

# Make sure the implicit rules never mistake a _template.cpp or _template.h file for source file.
options_holder_template.h options_template.cpp options_handler_get_option_template.cpp options_handler_set_option_template.cpp base_options_template.h base_options_template.cpp :;

# Make sure the implicit rules never mistake X_options for the -o file for a
# CPP file.
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 sets_options smt_options strings_options theory_options uf_options:;


# These are phony to force them to be made everytime.
.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 sets_options.tmp smt_options.tmp strings_options.tmp theory_options.tmp uf_options.tmp

# Make is happier being listed explictly. Not sure why.
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 sets_options.tmp smt_options.tmp strings_options.tmp theory_options.tmp uf_options.tmp:
	echo "$@" "$(@:.tmp=)"
	$(AM_V_GEN)(cp "@srcdir@/$(@:.tmp=)" "$@" || true)
#TIM:
#The (... || true) here is to make distcheck not fail.

%_options.options: %_options.tmp
	$(AM_V_GEN)\
	diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true


# This bit is kinda tricky.
# We use the updating of %_options.options to signal that the options file updated.
# However, we use the original file in src to generate the file.
%_options.sed: %_options.options mkoptions
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions module-sed "@srcdir@/$(@:.sed=)" ) > "$@"


$(CPP_TEMPLATE_SEDS): %.sed : % mkoptions
#	echo "template seds"
#	echo "$@"
#	echo $(TEMPLATE_SEDS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"

$(DOCUMENTATION_TEMPLATE_SEDS): %.sed : % mkoptions
#	echo "template seds"
#	echo "$@"
#	echo $(TEMPLATE_SEDS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions template-sed "$<" ) > "$@"

%_options.h : %_options.sed mkoptions base_options_template.h base_options_template.h.sed
#	echo heads
#	echo "$@"
#	echo $(OPTIONS_HEADS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/base_options_template.h \
		base_options_template.h.sed \
		"$<" \
	) > "$@"

summary.sed : mkoptions $(OPTIONS_OPTIONS_FILES)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions summary-sed \
		$(OPTIONS_OPTIONS_FILES) \
	) > summary.sed



#   mkoptions apply-sed-to-template sed-file template-file
options_holder.h : options_holder_template.h options_holder_template.h.sed summary.sed mkoptions $(OPTIONS_HEADS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/options_holder_template.h \
		@builddir@/options_holder_template.h.sed \
		summary.sed \
	) > "$@"

# Make sure not to match with "options.cpp" too.
%_options.cpp: %_options.sed %_options.h mkoptions options_holder.h base_options_template.cpp base_options_template.cpp.sed
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/base_options_template.cpp \
		base_options_template.cpp.sed \
		"$<" \
	) > "$@"




#   mkoptions apply-sed-to-template sed-file template-file
options.cpp : options_template.cpp options_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS) options_holder.h
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/options_template.cpp \
		@builddir@/options_template.cpp.sed \
		summary.sed \
	) > "$@"


#   mkoptions apply-sed-to-template sed-file template-file
options_handler_get_option.cpp : options_handler_get_option_template.cpp options_handler_get_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/options_handler_get_option_template.cpp \
		@builddir@/options_handler_get_option_template.cpp.sed \
		summary.sed \
	) > "$@"

options_handler_set_option.cpp : options_handler_set_option_template.cpp options_handler_set_option_template.cpp.sed mkoptions summary.sed $(OPTIONS_HEADS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/options_handler_set_option_template.cpp \
		@builddir@/options_handler_set_option_template.cpp.sed \
		summary.sed \
	) > "$@"



$(DOCUMENTATION_FILES) : % : %_template %_template.sed mkoptions summary.sed
#	echo "$<"
#	echo "$@"
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		"$<" \
		"$<".sed \
		@builddir@/summary.sed \
	) > "$@"



#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)


# This rule is ugly.  It's needed to ensure that automake's dependence
# includes are available during distclean, even though they come from
# directories that are cleaned first.  Without this rule, "distclean"
# fails.
%.Plo:; $(MKDIR_P) "$(dir $@)" && : > "$@"

generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback