Merge branch 'master' of https://github.com/CVC4/CVC4
[cvc5.git] / Makefile.builds.in
1 # -*- makefile -*-
2 #
3 # This Makefile produces the Makefile in the top-level builds/
4 # directory for standard-path builds (e.g., those configured from the
5 # source tree). It has some autoconf cruft in it, documented below.
6 #
7 # Its main purposes are to:
8 # 1. build the current build profile
9 # 2. install into "builds/$(CURRENT_BUILD)/$(prefix)"
10 # 3. set up "builds/$(CURRENT_BUILD)/{bin,lib}" symlinks
11 # 4. install into "builds/$(prefix)"
12 # 5. set up "builds/bin" and "builds/lib"
13 #
14 # Steps 2 and 4 require libtool-relinking for dynamically-linked
15 # executables and libraries, since build/bin is not the final
16 # installation path.
17
18 # Include the "current" build profile.
19 include current
20
21 # Set up $(MAKE)
22 @SET_MAKE@
23
24 # Set up some basic autoconf make vars
25 srcdir = @srcdir@
26 builddir = @builddir@
27 install_sh = @install_sh@
28 mkinstalldirs = $(install_sh) -d
29 exec_prefix = @exec_prefix@
30 prefix = @prefix@
31 bindir = @bindir@
32 libdir = @libdir@
33 abs_builddir = @abs_builddir@
34 distdir = @PACKAGE@-@VERSION@
35 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
36 EXEEXT = @EXEEXT@
37 SHELL = @SHELL@
38 LIBTOOL = $(CURRENT_BUILD)/libtool
39
40 # Are we building the libcvc4compat library ?
41 CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@
42
43 # Are we building static/dynamic libraries/binaries? One or the other can be
44 # on, or both.
45 BUILDING_STATIC = @BUILDING_STATIC@
46 BUILDING_SHARED = @BUILDING_SHARED@
47 STATIC_BINARY = @STATIC_BINARY@
48
49 # @
50 AM_V_at = $(am__v_at_$(V))
51 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
52 am__v_at_0 = @
53 am__v_at_1 =
54 # mkinstalldirs (never prefix with @; not a top-level instruction)
55 AM_V_mkdir_noat = $(am__v_mkdir_noat_$(V))
56 am__v_mkdir_noat_ = $(am__v_mkdir_noat_$(AM_DEFAULT_VERBOSITY))
57 am__v_mkdir_noat_0 = $(SHELL) -c 'echo " MKDIR $$@"; $(mkinstalldirs) "$$@"' bash
58 am__v_mkdir_noat_1 = $(mkinstalldirs)
59 # mkinstalldirs (can prefix with @)
60 AM_V_mkdir = $(am__v_mkdir_$(V))
61 am__v_mkdir_ = $(am__v_mkdir_$(AM_DEFAULT_VERBOSITY))
62 am__v_mkdir_0 = @$(am__v_mkdir_noat_0)
63 am__v_mkdir_1 = $(am__v_mkdir_noat_1)
64 # libtool --mode=install $(install_sh)
65 AM_V_ltinstall = $(am__v_ltinstall_$(V))
66 am__v_ltinstall_ = $(am__v_ltinstall_$(AM_DEFAULT_VERBOSITY))
67 am__v_ltinstall_0 = @$(SHELL) -c 'echo " LTINS $$1"; $(LIBTOOL) --silent --mode=install $(install_sh) "$$@"' bash
68 am__v_ltinstall_1 = $(LIBTOOL) --mode=install $(install_sh)
69 # install_sh (never prefix with @)
70 AM_V_install_sh_noat = $(am__v_install_sh_noat_$(V))
71 am__v_install_sh_noat_ = $(am__v_install_sh_noat_$(AM_DEFAULT_VERBOSITY))
72 am__v_install_sh_noat_0 = $(SHELL) -c 'echo " INSTL $$1"; $(install_sh) "$$@"' bash
73 am__v_install_sh_noat_1 = $(install_sh)
74 # relinking
75 AM_V_relink = $(am__v_relink_$(V))
76 am__v_relink_ = $(am__v_relink_$(AM_DEFAULT_VERBOSITY))
77 am__v_relink_0 = echo " RELNK"
78 am__v_relink_1 = :
79
80 # all the binaries that might need to be installed
81 # (it's not a fatal error for one/some don't exist in a given build
82 # configuration)
83 CVC4_BINARIES = cvc4$(EXEEXT) pcvc4$(EXEEXT)
84
85 .PHONY: _default_build_ all examples
86 _default_build_: all
87 all:
88 # build the current build profile
89 $(AM_V_at)(cd $(CURRENT_BUILD) && $(MAKE) $@)
90 # set up builds/$(CURRENT_BUILD)/...prefix.../bin
91 # and builds/$(CURRENT_BUILD)/...prefix.../lib
92 $(AM_V_mkdir) "$(CURRENT_BUILD)$(bindir)"
93 $(AM_V_mkdir) "$(CURRENT_BUILD)$(libdir)"
94 # install libcvc4
95 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la \
96 "$(abs_builddir)$(libdir)"
97 # install libcvc4parser
98 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
99 "$(abs_builddir)$(libdir)"
100 ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
101 # install libcvc4compat
102 $(CURRENT_BUILD)/libtool --mode=install $(install_sh) \
103 $(CURRENT_BUILD)/src/compat/libcvc4compat.la \
104 "$(abs_builddir)$(libdir)"
105 endif
106 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
107 # if we're building shared libs and the binary is not static, relink
108 # the handling with empty $relink_command is a hack for Mac OS
109 $(AM_V_at)thelibdir="$(abs_builddir)$(libdir)"; \
110 progdir="$(abs_builddir)$(bindir)"; for file in $(CVC4_BINARIES); do \
111 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
112 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
113 if test -z "$$relink_command"; then \
114 $(AM_V_mkdir_noat) "$(CURRENT_BUILD)$(bindir)/.libs"; \
115 $(AM_V_install_sh_noat) \
116 $(CURRENT_BUILD)/src/main/.libs/$$file \
117 "$(abs_builddir)$(bindir)/.libs"; \
118 $(AM_V_install_sh_noat) \
119 $(CURRENT_BUILD)/src/main/$$file \
120 "$(abs_builddir)$(bindir)"; \
121 else \
122 $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \
123 fi; \
124 else \
125 rm -f "$(abs_builddir)$(bindir)/$$file"; \
126 fi; \
127 done
128 else
129 # if we're building static libs only, just install the driver binary directly
130 $(AM_V_at)for file in $(CVC4_BINARIES); do \
131 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
132 $(AM_V_install_sh_noat) \
133 $(CURRENT_BUILD)/src/main/$$file \
134 "$(abs_builddir)$(bindir)"; \
135 else \
136 rm -f "$(abs_builddir)$(bindir)/$$file"; \
137 fi; \
138 done
139 endif
140 # set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib
141 rm -f $(CURRENT_BUILD)/lib; ln -sf "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib
142 rm -f $(CURRENT_BUILD)/bin; ln -sf "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin
143 # set up builds/...prefix.../bin and builds/...prefix.../lib
144 $(AM_V_mkdir) ".$(bindir)"
145 $(AM_V_mkdir) ".$(libdir)"
146 # install libcvc4
147 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
148 # install libcvc4parser
149 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
150 ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
151 # install libcvc4compat
152 $(CURRENT_BUILD)/libtool --mode=install $(install_sh) $(CURRENT_BUILD)/src/compat/libcvc4compat.la "`pwd`$(libdir)"
153 endif
154 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
155 # if we're building shared libs and the binary is not static, relink
156 # the handling with empty $relink_command is a hack for Mac OS
157 $(AM_V_at)thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; for file in $(CVC4_BINARIES); do \
158 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
159 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
160 if test -z "$$relink_command"; then \
161 $(AM_V_mkdir_noat) ".$(bindir)/.libs"; \
162 $(AM_V_install_sh_noat) \
163 $(CURRENT_BUILD)/src/main/.libs/$$file \
164 "`pwd`$(bindir)/.libs"; \
165 $(AM_V_install_sh_noat) \
166 $(CURRENT_BUILD)/src/main/$$file \
167 "`pwd`$(bindir)"; \
168 else \
169 $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \
170 fi; \
171 else \
172 rm -f "`pwd`$(bindir)/$$file"; \
173 fi; \
174 done
175 else
176 # if we're building static libs only, just install the driver binary directly
177 $(AM_V_at)for file in $(CVC4_BINARIES); do \
178 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
179 $(AM_V_install_sh_noat) \
180 $(CURRENT_BUILD)/src/main/$$file \
181 "`pwd`$(bindir)"; \
182 else \
183 rm -f "`pwd`$(bindir)/$$file"; \
184 fi; \
185 done
186 endif
187 # set up builds/bin and builds/lib
188 rm -f lib; ln -sf ".$(libdir)" lib
189 rm -f bin; ln -sf ".$(bindir)" bin
190 rm -f doc; ln -sf "$(CURRENT_BUILD)/doc" doc
191 rm -f examples; ln -sf "$(CURRENT_BUILD)/examples" examples
192
193 # The descent into "src" with target "check" is to build check
194 # prerequisites (e.g. CHECK_PROGRAMS, CHECK_LTLIBRARIES, ...).
195 check test units: all
196 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
197 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
198 systemtests regress: all
199 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
200 units%: all
201 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
202 +(cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@))
203 regress%: all
204 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
205
206 dist:
207 (cd $(CURRENT_BUILD) && $(MAKE) $@)
208 $(install_sh) \
209 $(CURRENT_BUILD)/$(distdir).tar.gz \
210 "`pwd`"
211
212 TAGS tags:
213 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
214 ln -sf $(CURRENT_BUILD)/TAGS .
215
216 .PHONY: TAGS tags
217
218 .PHONY: doc-builds doc-prereq
219 doc-builds: doc-prereq
220 +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="`builddir="$(builddir)" srcdir="$(srcdir)" "$(srcdir)/doc/find_public_interface.sh"`")
221 doc-internals-builds: doc-prereq
222 +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="$(srcdir)/src src")
223 doc-prereq:
224 +(cd $(CURRENT_BUILD) && for dir in `find . -name Makefile | xargs grep -l BUILT_SOURCES`; do (cd `dirname "$$dir"`; (cat Makefile; echo 'doc-prereq: $$(BUILT_SOURCES)') | $(MAKE) -f- doc-prereq); done)
225
226 # Any other target than the default doesn't do the extra stuff above.
227 # Split out "examples" target, recent Makes don't want them combined.
228 examples:
229 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
230 %:
231 +(cd $(CURRENT_BUILD) && $(MAKE) $@)