fix to build system: #include the proper file when they are in both builds and src
[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@builddir@/.. -I@srcdir@/../include -I@srcdir@/..
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 CLEANFILES = \
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 options-stamp \
119 ../smt/smt_options.cpp \
120 options.cpp \
121 options_holder.h \
122 $(OPTIONS_FILES_SRCS)
123
124 if CVC4_DEBUG
125 # listing Debug_tags too ensures that make doesn't auto-remove it
126 # after building (if it does, we don't get the "cached" effect with
127 # the .tmp files below, and we have to re-compile and re-link each
128 # time, even when there are no changes).
129 BUILT_SOURCES += \
130 Debug_tags.h \
131 Debug_tags
132 endif
133 if CVC4_TRACING
134 # listing Trace_tags too ensures that make doesn't auto-remove it
135 # after building (if it does, we don't get the "cached" effect with
136 # the .tmp files below, and we have to re-compile and re-link each
137 # time, even when there are no changes).
138 BUILT_SOURCES += \
139 Trace_tags.h \
140 Trace_tags
141 endif
142 %_tags.h: %_tags
143 $(AM_V_GEN)( \
144 echo 'static char const* const $^[] = {'; \
145 for tag in `cat $^`; do \
146 echo "\"$$tag\","; \
147 done; \
148 echo 'NULL'; \
149 echo '};' \
150 ) >"$@"
151
152 # This .tmp business is to keep from having to re-compile options.cpp
153 # (and then re-link the libraries) if nothing has changed.
154 %_tags: %_tags.tmp
155 $(AM_V_GEN)\
156 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
157 # .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
158 .PHONY: Debug_tags.tmp Trace_tags.tmp
159 # The "sed" invocation below is particularly obnoxious, but it works around
160 # inconsistencies in REs on different platforms, using only a basic regular
161 # expression (no |, no \<, ...).
162 Debug_tags.tmp Trace_tags.tmp:
163 $(AM_V_GEN)\
164 grep '\<$(@:_tags.tmp=)\(\.isOn\)* *( *\".*\" *)' \
165 `find @srcdir@/../ -name "*.cpp" -o -name "*.h" -o -name "*.cc" -o -name "*.g"` | \
166 sed 's/^$(@:_tags.tmp=)\(\.isOn\)* *( *\"\([^"]*\)\".*/\2/;s/.*[^a-zA-Z0-9_]$(@:_tags.tmp=)\(\.isOn\)* *( *\"\([^"]*\)\".*/\2/' | LC_ALL=C sort | uniq >"$@"
167
168 MOSTLYCLEANFILES = \
169 Debug_tags \
170 Trace_tags \
171 Debug_tags.tmp \
172 Trace_tags.tmp \
173 Debug_tags.h \
174 Trace_tags.h
175
176 options_holder.h options.cpp ../smt/smt_options.cpp $(OPTIONS_FILES_SRCS): options-stamp
177 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)
178 $(AM_V_at)chmod +x @srcdir@/mkoptions
179 $(AM_V_GEN)(@srcdir@/mkoptions \
180 @srcdir@/options_holder_template.h @builddir@/options_holder.h \
181 @srcdir@/options_template.cpp @builddir@/options.cpp \
182 @srcdir@/../smt/smt_options_template.cpp @builddir@/../smt/smt_options.cpp \
183 @top_builddir@/doc/cvc4.1_template @top_builddir@/doc/cvc4.1 \
184 @top_builddir@/doc/libcvc4.3_template @top_builddir@/doc/libcvc4.3 \
185 @top_builddir@/doc/SmtEngine.3cvc_template @top_builddir@/doc/SmtEngine.3cvc \
186 @top_builddir@/doc/options.3cvc_template @top_builddir@/doc/options.3cvc \
187 -t \
188 @srcdir@/base_options_template.h @srcdir@/base_options_template.cpp \
189 $(foreach o,$(OPTIONS_FILES),"$(srcdir)/$(o)" "$(patsubst %/,%,$(dir $(o)))") \
190 )
191 touch "$@"
192
193 $(OPTIONS_FILES):;
194
195 # This rule is ugly. It's needed to ensure that automake's dependence
196 # includes are available during distclean, even though they come from
197 # directories that are cleaned first. Without this rule, "distclean"
198 # fails.
199 %.Plo:; $(MKDIR_P) "$(dir $@)" && : > "$@"
200
201 .PHONY: exprs-builts
202 exprs-builts:; $(AM_V_at)[ "$(FROM_EXPR)" != 1 ] && $(MAKE) -C ../expr builts || true