summaryrefslogtreecommitdiff
path: root/Makefile.builds.in
blob: 265556f4df865e347851d57dc241eb741b938f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# -*- makefile -*-
#
# This Makefile produces the Makefile in the top-level builds/
# directory for standard-path builds (e.g., those configured from the
# source tree).  It has some autoconf cruft in it, documented below.
#
# Its main purposes are to:
# 1. build the current build profile
# 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

# Set up $(MAKE)
@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@
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)

# 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 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) $@)
	$(install_sh) \
		$(CURRENT_BUILD)/$(distdir).tar.gz \
		"`pwd`"

TAGS tags:
	+(cd $(CURRENT_BUILD) && $(MAKE) $@)
	ln -sf $(CURRENT_BUILD)/TAGS .

.PHONY: TAGS tags

.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) $@)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback