squash-merge from proof branch
[cvc5.git] / Makefile.builds.in
index 5e5beb9606494eab078aa617c98c879e2a99ce56..265556f4df865e347851d57dc241eb741b938f70 100644 (file)
@@ -6,14 +6,8 @@
 #
 # Its main purposes are to:
 # 1. build the current build profile
-# 2. install into "builds/$(CURRENT_BUILD)/$(prefix)"
-# 3. set up "builds/$(CURRENT_BUILD)/{bin,lib}" symlinks
-# 4. install into "builds/$(prefix)"
-# 5. set up "builds/bin" and "builds/lib"
-#
-# Steps 2 and 4 require libtool-relinking for dynamically-linked
-# executables and libraries, since build/bin is not the final
-# installation path.
+# 2. set up builds/$(CURRENT_BUILD)/{bin,lib} symlinks
+# 3. set up builds/bin and builds/lib symlinks
 
 # Include the "current" build profile.
 include current
@@ -22,6 +16,8 @@ include current
 @SET_MAKE@
 
 # Set up some basic autoconf make vars
+srcdir = @srcdir@
+builddir = @builddir@
 install_sh = @install_sh@
 mkinstalldirs = $(install_sh) -d
 exec_prefix = @exec_prefix@
@@ -29,66 +25,119 @@ prefix = @prefix@
 bindir = @bindir@
 libdir = @libdir@
 abs_builddir = @abs_builddir@
+distdir = @PACKAGE@-@VERSION@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+EXEEXT = @EXEEXT@
+SHELL = @SHELL@
+LIBTOOL = $(CURRENT_BUILD)/libtool
+
+# Are we building the libcvc4compat library ?
+CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@
+
+# @
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+am__v_at_1 =
+# mkinstalldirs (never prefix with @; not a top-level instruction)
+AM_V_mkdir_noat = $(am__v_mkdir_noat_$(V))
+am__v_mkdir_noat_ = $(am__v_mkdir_noat_$(AM_DEFAULT_VERBOSITY))
+am__v_mkdir_noat_0 = $(SHELL) -c 'echo "   MKDIR $$@"; $(mkinstalldirs) "$$@"' bash
+am__v_mkdir_noat_1 = $(mkinstalldirs)
+# mkinstalldirs (can prefix with @)
+AM_V_mkdir = $(am__v_mkdir_$(V))
+am__v_mkdir_ = $(am__v_mkdir_$(AM_DEFAULT_VERBOSITY))
+am__v_mkdir_0 = @$(am__v_mkdir_noat_0)
+am__v_mkdir_1 = $(am__v_mkdir_noat_1)
 
-# Are we building static/dynamic libraries/binaries?  One or the other can be
-# on, or both.
-BUILDING_STATIC = @BUILDING_STATIC@
-BUILDING_SHARED = @BUILDING_SHARED@
-STATIC_BINARY = @STATIC_BINARY@
+# all the binaries that might need to be installed
+# (it's not a fatal error for one/some don't exist in a given build
+# configuration)
+CVC4_BINARIES = cvc4$(EXEEXT) pcvc4$(EXEEXT)
 
-.PHONY: _default_build_ all
+.PHONY: _default_build_ all examples
 _default_build_: all
 all:
 #      build the current build profile
+       $(AM_V_at)(cd $(CURRENT_BUILD) && $(MAKE) $@)
+#      set up builds/$(CURRENT_BUILD)/{bin,lib}
+       $(AM_V_mkdir) $(CURRENT_BUILD)/bin
+       $(AM_V_mkdir) $(CURRENT_BUILD)/lib
+#      symlink libcvc4, libcvc4parser
+       $(AM_V_at)cd $(CURRENT_BUILD)/lib && \
+       ln -sf ../src/libcvc4.* \
+               ../src/parser/libcvc4parser.* \
+               .
+       -$(AM_V_at)cd $(CURRENT_BUILD)/lib && \
+       test -d ../src/.libs && \
+       ln -sf ../src/.libs/libcvc4.* \
+               .
+       -$(AM_V_at)cd $(CURRENT_BUILD)/lib && \
+       test -d ../src/parser/.libs && \
+       ln -sf ../src/parser/.libs/libcvc4parser.* \
+               .
+ifeq ($(CVC4_BUILD_LIBCOMPAT),yes)
+#      symlink libcvc4compat
+       $(AM_V_at)cd $(CURRENT_BUILD)/lib && \
+       ln -sf ../src/compat/libcvc4compat.* \
+               .
+       -$(AM_V_at)cd $(CURRENT_BUILD)/lib && \
+       test -d ../src/compat/.libs && \
+       ln -sf ../src/compat/.libs/libcvc4compat.* \
+               .
+endif
+#      symlink the binaries
+       $(AM_V_at)cd $(CURRENT_BUILD)/bin && \
+       for binary in $(CVC4_BINARIES); do \
+               if test -x ../src/main/$$binary; then \
+                       ln -sf ../src/main/$$binary \
+                               . ; \
+               else \
+                       rm -f "$$binary"; \
+               fi; \
+       done
+#      set up builds/doc and builds/examples
+       $(AM_V_at)rm -f bin; ln -sf $(CURRENT_BUILD)/bin bin
+       $(AM_V_at)rm -f lib; ln -sf $(CURRENT_BUILD)/lib lib
+       $(AM_V_at)rm -f doc; ln -sf $(CURRENT_BUILD)/doc doc
+       $(AM_V_at)rm -f examples; ln -sf $(CURRENT_BUILD)/examples examples
+
+# The descent into "src" with target "check" is to build check
+# prerequisites (e.g. CHECK_PROGRAMS, CHECK_LTLIBRARIES, ...).
+check test units: all
+       (cd $(CURRENT_BUILD)/src && $(MAKE) check)
+       +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
+systemtests regress: all
+       +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
+units%: all
+       (cd $(CURRENT_BUILD)/src && $(MAKE) check)
+       +(cd $(CURRENT_BUILD)/test && $(MAKE) units TEST_PREFIX=$(subst units:,,$@))
+regress%: all
+       +(cd $(CURRENT_BUILD)/test && $(MAKE) $@)
+
+dist:
        (cd $(CURRENT_BUILD) && $(MAKE) $@)
-#      set up builds/$(CURRENT_BUILD)/...prefix.../bin
-#      and builds/$(CURRENT_BUILD)/...prefix.../lib
-       $(mkinstalldirs) "$(CURRENT_BUILD)$(bindir)" "$(CURRENT_BUILD)$(libdir)"
-#      install libcvc4
-       $(CURRENT_BUILD)/libtool --mode=install install -v \
-               $(CURRENT_BUILD)/src/libcvc4.la \
-               "$(abs_builddir)$(libdir)"
-#      install libcvc4parser
-       $(CURRENT_BUILD)/libtool --mode=install install -v \
-               $(CURRENT_BUILD)/src/parser/libcvc4parser.la \
-               "$(abs_builddir)$(libdir)"
-ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
-#      if we're building shared libs and the binary is not static, relink
-       thelibdir="$(abs_builddir)$(libdir)"; \
-       progdir="$(abs_builddir)$(bindir)"; file=cvc4; \
-               eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
-               eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
-else
-#      if we're building static libs only, just install the driver binary directly
        $(install_sh) \
-               $(CURRENT_BUILD)/src/main/cvc4 \
-               "$(abs_builddir)$(bindir)"
-endif
-#      set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib
-       test -e $(CURRENT_BUILD)/lib || ln -sfv "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib
-       test -e $(CURRENT_BUILD)/bin || ln -sfv "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin
-#      set up builds/...prefix.../bin and builds/...prefix.../lib
-       $(mkinstalldirs) ".$(bindir)" ".$(libdir)"
-#      install libcvc4
-       $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)"
-#      install libcvc4parser
-       $(CURRENT_BUILD)/libtool --mode=install install -v $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)"
-ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10)
-#      if we're building shared libs and the binary is not static, relink
-       thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; file=cvc4; \
-               eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/cvc4 | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \
-               eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"
-else
-#      if we're building static libs only, just install the driver binary directly
-       $(install_sh) $(CURRENT_BUILD)/src/main/cvc4 "`pwd`$(bindir)"
-endif
-#      set up builds/bin and builds/lib
-       test -e lib || ln -sfv ".$(libdir)" lib
-       test -e bin || ln -sfv ".$(bindir)" bin
+               $(CURRENT_BUILD)/$(distdir).tar.gz \
+               "`pwd`"
+
+TAGS tags:
+       +(cd $(CURRENT_BUILD) && $(MAKE) $@)
+       ln -sf $(CURRENT_BUILD)/TAGS .
 
-check regress regress0 regress1 regress2 regress3: all
-       (cd $(CURRENT_BUILD)/test && $(MAKE) $@)
+.PHONY: TAGS tags
 
-# any other target than the default doesn't do the extra stuff above
+.PHONY: doc-builds doc-prereq
+doc-builds: doc-prereq
+       +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="`builddir="$(builddir)" srcdir="$(srcdir)" "$(srcdir)/doc/find_public_interface.sh"`")
+doc-internals-builds: doc-prereq
+       +(cd $(CURRENT_BUILD) && $(MAKE) doxygen-doc CVC4_DOXYGEN_INPUT="$(srcdir)/src src")
+doc-prereq:
+       +(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)
+
+# Any other target than the default doesn't do the extra stuff above.
+# Split out "examples" target, recent Makes don't want them combined.
+examples:
+       +(cd $(CURRENT_BUILD) && $(MAKE) $@)
 %:
-       (cd $(CURRENT_BUILD) && $(MAKE) $@)
+       +(cd $(CURRENT_BUILD) && $(MAKE) $@)