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@
33 # Are we building static/dynamic libraries/binaries? One or the other can be
35 BUILDING_STATIC = @BUILDING_STATIC@
36 BUILDING_SHARED = @BUILDING_SHARED@
37 STATIC_BINARY = @STATIC_BINARY@
39 .PHONY: _default_build_ all
42 # build the current build profile
43 (cd $(CURRENT_BUILD) && $(MAKE) $@)
44 # set up builds/$(CURRENT_BUILD)/...prefix.../bin
45 # and builds/$(CURRENT_BUILD)/...prefix.../lib
46 $(mkinstalldirs) "$(CURRENT_BUILD)$(bindir)" "$(CURRENT_BUILD)$(libdir)"
48 $(CURRENT_BUILD)/libtool --mode=install install -v \
49 $(CURRENT_BUILD)/src/libcvc4.la \
50 "$(abs_builddir)$(libdir)"
51 # install libcvc4parser
52 $(CURRENT_BUILD)/libtool --mode=install install -v \
53 $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
54 "$(abs_builddir)$(libdir)"
55 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
56 # if we're building shared libs and the binary is not static, relink
57 thelibdir="$(abs_builddir)$(libdir)"; \
58 progdir="$(abs_builddir)$(bindir)"; file=cvc4; \
59 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
60 eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
62 # if we're building static libs only, just install the driver binary directly
64 $(CURRENT_BUILD)/src/main/cvc4 \
65 "$(abs_builddir)$(bindir)"
67 # set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib
68 test -e $(CURRENT_BUILD)/lib || ln -sfv "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib
69 test -e $(CURRENT_BUILD)/bin || ln -sfv "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin
70 # set up builds/...prefix.../bin and builds/...prefix.../lib
71 $(mkinstalldirs) ".$(bindir)" ".$(libdir)"
73 $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
74 # install libcvc4parser
75 $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
76 ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
77 # if we're building shared libs and the binary is not static, relink
78 thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; file=cvc4; \
79 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
80 eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
82 # if we're building static libs only, just install the driver binary directly
83 $(install_sh) $(CURRENT_BUILD)/src/main/cvc4 "`pwd`$(bindir)"
85 # set up builds/bin and builds/lib
86 test -e lib || ln -sfv ".$(libdir)" lib
87 test -e bin || ln -sfv ".$(bindir)" bin
89 check test units regress: all
90 (cd $(CURRENT_BUILD)/test && $(MAKE) $@)
92 (cd $(CURRENT_BUILD)/test && $(MAKE) $@)
95 (cd $(CURRENT_BUILD) && $(MAKE) $@)
96 ln -sf $(CURRENT_BUILD)/TAGS .
100 # any other target than the default doesn't do the extra stuff above
102 (cd $(CURRENT_BUILD) && $(MAKE) $@)