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.
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"
14 # Steps 2 and 4 require libtool-relinking for dynamically-linked
15 # executables and libraries, since build/bin is not the final
18 # Include the "current" build profile.
24 # Set up some basic autoconf make vars
25 install_sh = @install_sh@
26 mkinstalldirs = $(install_sh) -d
27 exec_prefix = @exec_prefix@
31 abs_builddir = @abs_builddir@
32 distdir = @PACKAGE@-@VERSION@
33 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
35 LIBTOOL = $(CURRENT_BUILD)/libtool
37 # Are we building the libcvc4compat library ?
38 CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@
40 # Are we building static/dynamic libraries/binaries? One or the other can be
42 BUILDING_STATIC = @BUILDING_STATIC@
43 BUILDING_SHARED = @BUILDING_SHARED@
44 STATIC_BINARY = @STATIC_BINARY@
47 AM_V_at = $(am__v_at_$(V))
48 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
51 # mkinstalldirs (never prefix with @; not a top-level instruction)
52 AM_V_mkdir_noat = $(am__v_mkdir_noat_$(V))
53 am__v_mkdir_noat_ = $(am__v_mkdir_noat_$(AM_DEFAULT_VERBOSITY))
54 am__v_mkdir_noat_0 = $(SHELL) -c 'echo " MKDIR $$@"; $(mkinstalldirs) "$$@"' bash
55 am__v_mkdir_noat_1 = $(mkinstalldirs)
56 # mkinstalldirs (can prefix with @)
57 AM_V_mkdir = $(am__v_mkdir_$(V))
58 am__v_mkdir_ = $(am__v_mkdir_$(AM_DEFAULT_VERBOSITY))
59 am__v_mkdir_0 = @$(am__v_mkdir_noat_0)
60 am__v_mkdir_1 = $(am__v_mkdir_noat_1)
61 # libtool --mode=install install
62 AM_V_ltinstall = $(am__v_ltinstall_$(V))
63 am__v_ltinstall_ = $(am__v_ltinstall_$(AM_DEFAULT_VERBOSITY))
64 am__v_ltinstall_0 = @$(SHELL) -c 'echo " LTINS $$1"; $(LIBTOOL) --silent --mode=install install "$$@"' bash
65 am__v_ltinstall_1 = $(LIBTOOL) --mode=install install
66 # install_sh (never prefix with @)
67 AM_V_install_sh_noat = $(am__v_install_sh_noat_$(V))
68 am__v_install_sh_noat_ = $(am__v_install_sh_noat_$(AM_DEFAULT_VERBOSITY))
69 am__v_install_sh_noat_0 = $(SHELL) -c 'echo " INSTL $$1"; $(install_sh) "$$@"' bash
70 am__v_install_sh_noat_1 = $(install_sh)
72 AM_V_relink = $(am__v_relink_$(V))
73 am__v_relink_ = $(am__v_relink_$(AM_DEFAULT_VERBOSITY))
74 am__v_relink_0 = echo " RELNK"
77 # all the binaries that might need to be installed
78 # (it's not a fatal error for one/some don't exist in a given build
80 CVC4_BINARIES = cvc4 pcvc4
82 .PHONY: _default_build_ all
85 # build the current build profile
86 $(AM_V_at)(cd $(CURRENT_BUILD) && $(MAKE) $@)
87 # set up builds/$(CURRENT_BUILD)/...prefix.../bin
88 # and builds/$(CURRENT_BUILD)/...prefix.../lib
89 $(AM_V_mkdir) "$(CURRENT_BUILD)$(bindir)"
90 $(AM_V_mkdir) "$(CURRENT_BUILD)$(libdir)"
92 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la \
93 "$(abs_builddir)$(libdir)"
94 # install libcvc4parser
95 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
96 "$(abs_builddir)$(libdir)"
97 ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
98 # install libcvc4compat
99 $(CURRENT_BUILD)/libtool --mode=install install -v \
100 $(CURRENT_BUILD)/src/compat/libcvc4compat.la \
101 "$(abs_builddir)$(libdir)"
103 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
104 # if we're building shared libs and the binary is not static, relink
105 # the handling with empty $relink_command is a hack for Mac OS
106 $(AM_V_at)thelibdir="$(abs_builddir)$(libdir)"; \
107 progdir="$(abs_builddir)$(bindir)"; for file in $(CVC4_BINARIES); do \
108 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
109 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
110 if test -z "$$relink_command"; then \
111 $(AM_V_mkdir_noat) "$(CURRENT_BUILD)$(bindir)/.libs"; \
112 $(AM_V_install_sh_noat) \
113 $(CURRENT_BUILD)/src/main/.libs/$$file \
114 "$(abs_builddir)$(bindir)/.libs"; \
115 $(AM_V_install_sh_noat) \
116 $(CURRENT_BUILD)/src/main/$$file \
117 "$(abs_builddir)$(bindir)"; \
119 $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \
122 rm -f "$(abs_builddir)$(bindir)/$$file"; \
126 # if we're building static libs only, just install the driver binary directly
127 $(AM_V_at)for file in $(CVC4_BINARIES); do \
128 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
129 $(AM_V_install_sh_noat) \
130 $(CURRENT_BUILD)/src/main/$$file \
131 "$(abs_builddir)$(bindir)"; \
133 rm -f "$(abs_builddir)$(bindir)/$$file"; \
137 # set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib
138 $(AM_V_at)test -e $(CURRENT_BUILD)/lib || ln -sfv "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib
139 $(AM_V_at)test -e $(CURRENT_BUILD)/bin || ln -sfv "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin
140 # set up builds/...prefix.../bin and builds/...prefix.../lib
141 $(AM_V_mkdir) ".$(bindir)"
142 $(AM_V_mkdir) ".$(libdir)"
144 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
145 # install libcvc4parser
146 $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
147 ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
148 # install libcvc4compat
149 $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/compat/libcvc4compat.la "`pwd`$(libdir)"
151 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
152 # if we're building shared libs and the binary is not static, relink
153 # the handling with empty $relink_command is a hack for Mac OS
154 $(AM_V_at)thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; for file in $(CVC4_BINARIES); do \
155 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
156 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
157 if test -z "$$relink_command"; then \
158 $(AM_V_mkdir_noat) ".$(bindir)/.libs"; \
159 $(AM_V_install_sh_noat) \
160 $(CURRENT_BUILD)/src/main/.libs/$$file \
161 "`pwd`$(bindir)/.libs"; \
162 $(AM_V_install_sh_noat) \
163 $(CURRENT_BUILD)/src/main/$$file \
166 $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \
169 rm -f "`pwd`$(bindir)/$$file"; \
173 # if we're building static libs only, just install the driver binary directly
174 $(AM_V_at)for file in $(CVC4_BINARIES); do \
175 if test -r $(CURRENT_BUILD)/src/main/$$file; then \
176 $(AM_V_install_sh_noat) \
177 $(CURRENT_BUILD)/src/main/$$file \
180 rm -f "`pwd`$(bindir)/$$file"; \
184 # set up builds/bin and builds/lib
185 $(AM_V_at)test -e lib || ln -sfv ".$(libdir)" lib
186 $(AM_V_at)test -e bin || ln -sfv ".$(bindir)" bin
187 rm -f examples; ln -sf "$(CURRENT_BUILD)/examples" examples
189 # The descent into "src" with target "check" is to build check
190 # prerequisites (e.g. CHECK_PROGRAMS, CHECK_LTLIBRARIES, ...).
192 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
193 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
194 systemtests regress: all
195 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
197 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
198 +(cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@))
200 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
203 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
205 $(CURRENT_BUILD)/$(distdir).tar.gz \
209 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
210 ln -sf $(CURRENT_BUILD)/TAGS .
214 .PHONY: doc-builds doc-prereq
215 doc-builds: doc-prereq
216 +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc)
218 +(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)
220 # any other target than the default doesn't do the extra stuff above
222 +(cd $(CURRENT_BUILD) && $(MAKE) $@)