* Add virtual destructors to CnfStream, Theory, OutputChannel, and
[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 install_sh = @install_sh@
26 mkinstalldirs = $(install_sh) -d
27 exec_prefix = @exec_prefix@
28 prefix = @prefix@
29 bindir = @bindir@
30 libdir = @libdir@
31 abs_builddir = @abs_builddir@
32
33 # Are we building static/dynamic libraries? One or the other can be
34 # on, or both.
35 BUILDING_STATIC = @BUILDING_STATIC@
36 BUILDING_SHARED = @BUILDING_SHARED@
37
38 .PHONY: _default_build_ all
39 _default_build_: all
40 all:
41 # build the current build profile
42 (cd $(CURRENT_BUILD) && $(MAKE) $@)
43 # set up builds/$(CURRENT_BUILD)/...prefix.../bin
44 # and builds/$(CURRENT_BUILD)/...prefix.../lib
45 $(mkinstalldirs) "$(CURRENT_BUILD)$(bindir)" "$(CURRENT_BUILD)$(libdir)"
46 # install libcvc4
47 $(CURRENT_BUILD)/libtool --mode=install install -v \
48 $(CURRENT_BUILD)/src/libcvc4.la \
49 "$(abs_builddir)$(libdir)"
50 # install libcvc4parser
51 $(CURRENT_BUILD)/libtool --mode=install install -v \
52 $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
53 "$(abs_builddir)$(libdir)"
54 ifeq ($(BUILDING_SHARED),1)
55 # if we're building shared libs, relink
56 thelibdir="$(abs_builddir)$(libdir)"; \
57 progdir="$(abs_builddir)$(bindir)"; file=cvc4; \
58 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
59 eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
60 else
61 # if we're building static libs only, just install the driver binary directly
62 $(install_sh) \
63 $(CURRENT_BUILD)/src/main/cvc4 \
64 "$(abs_builddir)$(bindir)"
65 endif
66 # set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib
67 test -e $(CURRENT_BUILD)/lib || ln -sfv "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib
68 test -e $(CURRENT_BUILD)/bin || ln -sfv "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin
69 # set up builds/...prefix.../bin and builds/...prefix.../lib
70 $(mkinstalldirs) ".$(bindir)" ".$(libdir)"
71 # install libcvc4
72 $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
73 # install libcvc4parser
74 $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
75 ifeq ($(BUILDING_SHARED),1)
76 # if we're building shared libs, relink
77 thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; file=cvc4; \
78 eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
79 eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
80 else
81 # if we're building static libs only, just install the driver binary directly
82 $(install_sh) $(CURRENT_BUILD)/src/main/cvc4 "`pwd`$(bindir)"
83 endif
84 # set up builds/bin and builds/lib
85 test -e lib || ln -sfv ".$(libdir)" lib
86 test -e bin || ln -sfv ".$(bindir)" bin
87
88 # any other target than the default doesn't do the extra stuff above
89 %:
90 (cd $(CURRENT_BUILD) && $(MAKE) $@)