summaryrefslogtreecommitdiff
path: root/src/options/Makefile.am
blob: 0d4b970d8482bf9ade3b7f0de95b76372293d8e6 (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
OPTIONS_FILES_SRCS = \
	base_options.cpp \
	base_options.h \
	../expr/options.cpp \
	../expr/options.h \
	../theory/booleans/options.cpp \
	../theory/booleans/options.h \
	../theory/options.cpp \
	../theory/options.h \
	../theory/bv/options.cpp \
	../theory/bv/options.h \
	../theory/datatypes/options.cpp \
	../theory/datatypes/options.h \
	../theory/builtin/options.cpp \
	../theory/builtin/options.h \
	../theory/arith/options.cpp \
	../theory/arith/options.h \
	../theory/uf/options.cpp \
	../theory/uf/options.h \
	../theory/arrays/options.cpp \
	../theory/arrays/options.h \
	../theory/quantifiers/options.cpp \
	../theory/quantifiers/options.h \
	../theory/strings/options.cpp \
	../theory/strings/options.h \
	../prop/options.cpp \
	../prop/options.h \
	../proof/options.cpp \
	../proof/options.h \
	../printer/options.cpp \
	../printer/options.h \
	../smt/options.cpp \
	../smt/options.h \
	../decision/options.cpp \
	../decision/options.h \
	../main/options.cpp \
	../main/options.h \
	../parser/options.cpp \
	../parser/options.h \
	../theory/idl/options.cpp \
	../theory/idl/options.h \
	../theory/sets/options.cpp \
	../theory/sets/options.h \
	../theory/fp/options.cpp \
	../theory/fp/options.h

OPTIONS_FILES = \
	$(patsubst %.cpp,%,$(filter %.cpp,$(OPTIONS_FILES_SRCS)))

OPTIONS_CPPS = \
	$(filter %.cpp,$(OPTIONS_FILES_SRCS))

OPTIONS_HEADS = \
	$(filter %.h,$(OPTIONS_FILES_SRCS))

OPTIONS_SEDS = \
	$(patsubst %,%.sed,$(OPTIONS_FILES))

OPTIONS_OBJ = \
	$(patsubst %.cpp,%.$(OBJEXT),$(OPTIONS_CPP))




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

TEMPLATE_FILES = \
	base_options_template.h \
	base_options_template.cpp \
	options_holder_template.h \
	options_template.cpp \
	../smt/smt_options_template.cpp \
	../../doc/cvc4.1_template \
	../../doc/libcvc4.3_template \
	../../doc/SmtEngine.3cvc_template \
	../../doc/options.3cvc_template

TEMPLATE_SEDS = \
	$(patsubst %,%.sed,$(TEMPLATE_FILES))

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 = \
	options.h \
	base_options_handlers.h \
	option_exception.h

nodist_liboptions_la_SOURCES = \
	options.cpp \
	options_holder.h \
	$(OPTIONS_FILES_SRCS)


BUILT_SOURCES = \
	exprs-builts \
	../smt/smt_options.cpp \
	options.cpp \
	options_holder.h \
	$(OPTIONS_FILES_SRCS) \
	$(OPTIONS_SEDS) \
	summary.sed \
	$(TEMPLATE_SEDS)


# The documentation files are added to BUILT_SOURCES to get the files to
# be built. Alternative suggestions for building these files would be
# appreciated.
BUILT_SOURCES += \
	$(DOCUMENTATION_FILES)


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

EXTRA_DIST = \
	mkoptions \
	base_options_template.h \
	base_options_template.cpp \
	options_template.cpp \
	options_holder_template.h \
	options.i \
	option_exception.i \
	$(OPTIONS_FILES) \
	mktagheaders \
	mktags \
	$(DOCUMENTATION_FILES)


# 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

%_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

#   mkoptions template-sed template-file (options-file)*
#   mkoptions apply-sed-files-to-template sed-file template-file filename

$(OPTIONS_FILES):;
options_holder_template.h options_template.cpp ../smt/smt_options_template.cpp base_options_template.h base_options_template.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 "$<" ) > "$@"


$(OPTIONS_SEDS) : %.sed : % mkoptions
#	echo "sedheads"
#	echo "$@"
#	echo $(OPTIONS_SEDS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_at)mkdir -p `dirname "$@"`
	$(AM_V_GEN)(@srcdir@/mkoptions module-sed "$<" ) > "$@"

$(OPTIONS_HEADS) : %.h : %.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_at)mkdir -p `dirname "$@"`
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/base_options_template.h \
		base_options_template.h.sed \
		"$<" \
	) > "$@"

summary.sed : mkoptions $(OPTIONS_FILES)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions summary-sed \
		$(foreach o,$(OPTIONS_FILES),"$(srcdir)/$(o)") \
	) > 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
#	echo "$(OPTIONS_FILES)"
	$(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 \
	) > "$@"

gen-heads-stamp : $(OPTIONS_HEADS) options_holder.h
.PHONY : gen-heads-stamp


# Bit of a hack here. The .h file needs to always be built before the .cpp file is compiled.
$(OPTIONS_CPPS) : %.cpp : %.sed mkoptions base_options_template.cpp base_options_template.cpp.sed gen-heads-stamp
#	echo "cpps"
#	echo "$@"
#	echo "$<"
#	echo $(OPTIONS_CPPS)
#	echo $(OPTIONS_FILES_SRCS)
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_at)mkdir -p `dirname "$@"`
	$(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 gen-heads-stamp
#	echo "$(OPTIONS_FILES)"
	$(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
../smt/smt_options.cpp : ../smt/smt_options_template.cpp ../smt/smt_options_template.cpp.sed mkoptions summary.sed gen-heads-stamp
#	echo "$(OPTIONS_FILES)"
	$(AM_V_at)chmod +x @srcdir@/mkoptions
	$(AM_V_GEN)(@srcdir@/mkoptions apply-sed-files-to-template \
		@srcdir@/../smt/smt_options_template.cpp \
		@builddir@/../smt/smt_options_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/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 $@)" && : > "$@"

# Tim:
# This is insanely ugly and brittle!
# *Any* proposal to clean this up is welcomed!
# We are overloading automake's default distclean here. We have to overload
# distclean because otherwise it deletes the dependency directory
# "src/expr/.deps", then when running make distclean in src/expr it attempts to
# include .Plo files "defined in src/expr/.deps".
# An example from src/expr/Makefile.ina :
# @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attribute.Plo@am__quote@
# The include must fail because this make file deleted that directory and
# distclean cannot proceed. So we override distclean to only remove
# "-rm -rf ./$(DEPDIR)". We then do manual massaging to finish up removing the
# extra files. To reproduce this, you can comment out the distclean below, run
# a distcheck and repeat this process.
# Why was this not a problem before? I do not know.
MANUAL_RM = \
	$(CLEANFILES) \
	../main/.dirstamp \
	../expr/.dirstamp \
	../options/options.lo \
	../options/base_options.lo \
	../options/.libs/options.o \
	../options/.libs/base_options.o \
	../options/.libs/liboptions.a \
	../options/Trace_tags.tmp \
	../options/Debug_tags.tmp \
	../options/liboptions.la \
	../parser/.dirstamp \
	../expr/.deps/options.Plo \
	../main/.deps/options.Plo \
	../parser/.deps/options.Plo \
	../prop/options.lo \
	../decision/options.lo \
	../printer/options.lo \
	../proof/options.lo \
	../smt/options.lo \
	../theory/arith/options.lo \
	../theory/arrays/options.lo \
	../theory/booleans/options.lo \
	../theory/builtin/options.lo \
	../theory/bv/options.lo \
	../theory/datatypes/options.lo \
	../theory/fp/options.lo \
	../theory/idl/options.lo \
	../theory/quantifiers/options.lo \
	../theory/sets/options.lo \
	../theory/strings/options.lo \
	../theory/test_newalttheory/options.lo \
	../theory/test_newtheory/options.lo \
	../theory/uf/options.lo \
	../theory/options.lo



distclean:
	-rm -rf ./$(DEPDIR)
	-rm -f Makefile
	-rm -f $(MANUAL_RM)

.PHONY: exprs-builts
exprs-builts:; $(AM_V_at)[ "$(FROM_EXPR)" != 1 ] && $(MAKE) -C ../expr builts || true

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