fixes to some *clean targets
[cvc5.git] / src / options / Makefile.am
1 OPTIONS_FILES = \
2 options/base_options \
3 expr/options \
4 theory/booleans/options \
5 theory/options \
6 theory/bv/options \
7 theory/datatypes/options \
8 theory/builtin/options \
9 theory/arith/options \
10 theory/uf/options \
11 theory/arrays/options \
12 theory/quantifiers/options \
13 theory/rewriterules/options \
14 prop/options \
15 proof/options \
16 printer/options \
17 smt/options \
18 decision/options \
19 main/options \
20 parser/options
21
22 AM_CPPFLAGS = \
23 -D__BUILDING_CVC4LIB \
24 -I@srcdir@/../include -I@srcdir@/.. -I@builddir@/..
25 AM_CXXFLAGS = -Wall $(FLAG_VISIBILITY_HIDDEN)
26
27 noinst_LTLIBRARIES = liboptions.la
28
29 liboptions_la_SOURCES = \
30 options.h \
31 base_options_handlers.h
32
33 nodist_liboptions_la_SOURCES = \
34 options.cpp \
35 options_holder.h \
36 $(OPTIONS_FILES:%=../%.cpp) \
37 $(OPTIONS_FILES:%=../%.h)
38 nodist_liboptions_la_OBJECTS = \
39 $(patsubst %.cpp,%.lo,$(filter %.cpp,$(nodist_liboptions_la_SOURCES)))
40
41 BUILT_SOURCES = \
42 options.cpp \
43 options_holder.h \
44 base_options.cpp \
45 base_options.h \
46 ../smt/smt_options.cpp \
47 $(OPTIONS_FILES:%=../%.cpp) \
48 $(OPTIONS_FILES:%=../%.h) \
49 exprs-builts
50
51 DISTCLEANFILES = \
52 $(BUILT_SOURCES) \
53 options-stamp
54
55 EXTRA_DIST = \
56 mkoptions \
57 base_options \
58 base_options_template.h \
59 base_options_template.cpp \
60 options_template.cpp \
61 options_holder_template.h \
62 options.i \
63 $(OPTIONS_FILES:%=../%)
64
65 if CVC4_DEBUG
66 # listing Debug_tags too ensures that make doesn't auto-remove it
67 # after building (if it does, we don't get the "cached" effect with
68 # the .tmp files below, and we have to re-compile and re-link each
69 # time, even when there are no changes).
70 BUILT_SOURCES += \
71 Debug_tags.h \
72 Debug_tags
73 endif
74 if CVC4_TRACING
75 # listing Trace_tags too ensures that make doesn't auto-remove it
76 # after building (if it does, we don't get the "cached" effect with
77 # the .tmp files below, and we have to re-compile and re-link each
78 # time, even when there are no changes).
79 BUILT_SOURCES += \
80 Trace_tags.h \
81 Trace_tags
82 endif
83 %_tags.h: %_tags
84 $(AM_V_GEN)( \
85 echo 'static char const* const $^[] = {'; \
86 for tag in `cat $^`; do \
87 echo "\"$$tag\","; \
88 done; \
89 echo 'NULL'; \
90 echo '};' \
91 ) >"$@"
92
93 # This .tmp business is to keep from having to re-compile options.cpp
94 # (and then re-link the libraries) if nothing has changed.
95 %_tags: %_tags.tmp
96 $(AM_V_GEN)\
97 diff -q "$^" "$@" &>/dev/null || mv "$^" "$@" || true
98 # .PHONY ensures the .tmp version is always rebuilt (to check for any changes)
99 .PHONY: Debug_tags.tmp Trace_tags.tmp
100 # The "sed" invocation below is particularly obnoxious, but it works around
101 # inconsistencies in REs on different platforms, using only a basic regular
102 # expression (no |, no \<, ...).
103 Debug_tags.tmp Trace_tags.tmp:
104 $(AM_V_GEN)\
105 grep '\<$(@:_tags.tmp=) *( *\".*\" *)' \
106 `find @srcdir@/../ -name "*.cpp" -or -name "*.h" -or -name "*.cc" -or -name "*.g"` | \
107 sed 's/^$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/;s/.*[^a-zA-Z0-9_]$(@:_tags.tmp=) *( *\"\([^"]*\)\".*/\1/' | sort | uniq >"$@"
108
109 MOSTLYCLEANFILES = \
110 Debug_tags \
111 Trace_tags \
112 Debug_tags.tmp \
113 Trace_tags.tmp \
114 Debug_tags.h \
115 Trace_tags.h
116
117 options_holder.h options.cpp ../smt/smt_options.cpp base_options.cpp base_options.h $(OPTIONS_FILES:%=../%.cpp) $(OPTIONS_FILES:%=../%.h): options-stamp
118 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:%=../%)
119 $(AM_V_at)chmod +x @srcdir@/mkoptions
120 $(AM_V_GEN)(@srcdir@/mkoptions \
121 @srcdir@/options_holder_template.h @builddir@/options_holder.h \
122 @srcdir@/options_template.cpp @builddir@/options.cpp \
123 @srcdir@/../smt/smt_options_template.cpp @builddir@/../smt/smt_options.cpp \
124 @top_builddir@/doc/cvc4.1_template @top_builddir@/doc/cvc4.1 \
125 -t \
126 @srcdir@/base_options_template.h @srcdir@/base_options_template.cpp \
127 $(foreach o,$(OPTIONS_FILES),"$(srcdir)/../$(o)" "$(dir $(builddir)/../$(o))") \
128 )
129 touch "$@"
130
131 base_options $(OPTIONS_FILES:%=../%):;
132
133 .PHONY: exprs-builts
134 exprs-builts:; $(AM_V_at)[ "$(FROM_EXPR)" != 1 ] && $(MAKE) -C ../expr builts || true