eb27bcac8be3f80a35f3fa90190c363ec64bbd30
[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. set up builds/$(CURRENT_BUILD)/{bin,lib} symlinks
10 # 3. set up builds/bin and builds/lib symlinks
11
12 # Include the "current" build profile.
13 include current
14
15 # Set up $(MAKE)
16 @SET_MAKE@
17
18 # Set up some basic autoconf make vars
19 srcdir = @srcdir@
20 builddir = @builddir@
21 install_sh = @install_sh@
22 mkinstalldirs = $(install_sh) -d
23 exec_prefix = @exec_prefix@
24 prefix = @prefix@
25 bindir = @bindir@
26 libdir = @libdir@
27 abs_builddir = @abs_builddir@
28 distdir = @PACKAGE@-@VERSION@
29 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
30 EXEEXT = @EXEEXT@
31 SHELL = @SHELL@
32 LIBTOOL = $(CURRENT_BUILD)/libtool
33
34 # Are we building the libcvc4compat library ?
35 CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@
36
37 # @
38 AM_V_at = $(am__v_at_$(V))
39 am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
40 am__v_at_0 = @
41 am__v_at_1 =
42 # mkinstalldirs (never prefix with @; not a top-level instruction)
43 AM_V_mkdir_noat = $(am__v_mkdir_noat_$(V))
44 am__v_mkdir_noat_ = $(am__v_mkdir_noat_$(AM_DEFAULT_VERBOSITY))
45 am__v_mkdir_noat_0 = $(SHELL) -c 'echo " MKDIR $$@"; $(mkinstalldirs) "$$@"' bash
46 am__v_mkdir_noat_1 = $(mkinstalldirs)
47 # mkinstalldirs (can prefix with @)
48 AM_V_mkdir = $(am__v_mkdir_$(V))
49 am__v_mkdir_ = $(am__v_mkdir_$(AM_DEFAULT_VERBOSITY))
50 am__v_mkdir_0 = @$(am__v_mkdir_noat_0)
51 am__v_mkdir_1 = $(am__v_mkdir_noat_1)
52
53 # all the binaries that might need to be installed
54 # (it's not a fatal error for one/some don't exist in a given build
55 # configuration)
56 CVC4_BINARIES = cvc4$(EXEEXT) pcvc4$(EXEEXT)
57
58 .PHONY: _default_build_ all examples
59 _default_build_: all
60 all:
61 # build the current build profile
62 $(AM_V_at)(cd $(CURRENT_BUILD) && $(MAKE) $@)
63 # set up builds/$(CURRENT_BUILD)/{bin,lib}
64 $(AM_V_mkdir) $(CURRENT_BUILD)/bin
65 $(AM_V_mkdir) $(CURRENT_BUILD)/lib
66 # symlink libcvc4, libcvc4parser
67 cd $(CURRENT_BUILD)/lib && \
68 ln -sf ../src/libcvc4.* \
69 ../src/parser/libcvc4parser.* \
70 .
71 -cd $(CURRENT_BUILD)/lib && \
72 test -d ../src/.libs && \
73 ln -sf ../src/.libs/libcvc4.* \
74 .
75 -cd $(CURRENT_BUILD)/lib && \
76 test -d ../src/parser/.libs && \
77 ln -sf ../src/parser/.libs/libcvc4parser.* \
78 .
79 ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
80 # symlink libcvc4compat
81 cd $(CURRENT_BUILD)/lib && \
82 ln -sf ../src/compat/libcvc4compat.* \
83 .
84 -cd $(CURRENT_BUILD)/lib && \
85 test -d ../src/compat/.libs && \
86 ln -sf ../src/compat/.libs/libcvc4compat.* \
87 .
88 endif
89 # symlink the binaries
90 cd $(CURRENT_BUILD)/bin && \
91 for binary in $(CVC4_BINARIES); do \
92 ln -sf ../src/main/$$binary \
93 . ; \
94 done
95 # set up builds/doc and builds/examples
96 rm -f bin; ln -sf $(CURRENT_BUILD)/bin bin
97 rm -f lib; ln -sf $(CURRENT_BUILD)/lib lib
98 rm -f doc; ln -sf $(CURRENT_BUILD)/doc doc
99 rm -f examples; ln -sf $(CURRENT_BUILD)/examples examples
100
101 # The descent into "src" with target "check" is to build check
102 # prerequisites (e.g. CHECK_PROGRAMS, CHECK_LTLIBRARIES, ...).
103 check test units: all
104 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
105 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
106 systemtests regress: all
107 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
108 units%: all
109 (cd $(CURRENT_BUILD)/src && $(MAKE) check)
110 +(cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@))
111 regress%: all
112 +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
113
114 dist:
115 (cd $(CURRENT_BUILD) && $(MAKE) $@)
116 $(install_sh) \
117 $(CURRENT_BUILD)/$(distdir).tar.gz \
118 "`pwd`"
119
120 TAGS tags:
121 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
122 ln -sf $(CURRENT_BUILD)/TAGS .
123
124 .PHONY: TAGS tags
125
126 .PHONY: doc-builds doc-prereq
127 doc-builds: doc-prereq
128 +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="`builddir="$(builddir)" srcdir="$(srcdir)" "$(srcdir)/doc/find_public_interface.sh"`")
129 doc-internals-builds: doc-prereq
130 +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="$(srcdir)/src src")
131 doc-prereq:
132 +(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)
133
134 # Any other target than the default doesn't do the extra stuff above.
135 # Split out "examples" target, recent Makes don't want them combined.
136 examples:
137 +(cd $(CURRENT_BUILD) && $(MAKE) $@)
138 %:
139 +(cd $(CURRENT_BUILD) && $(MAKE) $@)