aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-02 12:14:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-02 12:14:54 +0200
commit6c63b913179127e09ed7d9da8920493ccceec6ce (patch)
tree95684b51b4ab60e6468a592a53e33c2cf00027ab /build
parent3fd3cfc36784be43f545f2f0973e3dc58f475996 (diff)
Add make support for creating binary distributions
Two new make targets, dist and dist-win, were added that allow one to create a binary distribution from the current build. The dist target creates a UNIX distribution while dist-win -- Windows. The simplified build systems for the runtime library and examples that were kept separately are now part of the project (the dist/ subdirectory).
Diffstat (limited to 'build')
-rw-r--r--build/bootstrap.make49
1 files changed, 36 insertions, 13 deletions
diff --git a/build/bootstrap.make b/build/bootstrap.make
index ad55b12..afd4e4e 100644
--- a/build/bootstrap.make
+++ b/build/bootstrap.make
@@ -19,36 +19,59 @@ ifdef %interactive%
.PHONY: test $(out_base)/.test \
install $(out_base)/.install \
- clean $(out_base)/.clean
+ dist $(out_base)/.dist \
+ dist-win $(out_base)/.dist-win \
+ clean $(out_base)/.clean \
+ cleandoc $(out_base)/.cleandoc
test: $(out_base)/.test
install: $(out_base)/.install
+dist: $(out_base)/.dist
+dist-win: $(out_base)/.dist-win
clean: $(out_base)/.clean
+cleandoc: $(out_base)/.cleandoc
-ifeq ($(.DEFAULT_GOAL),test)
+ifneq ($(filter $(.DEFAULT_GOAL),test install dist dist-win clean cleandoc),)
.DEFAULT_GOAL :=
endif
-ifeq ($(.DEFAULT_GOAL),install)
-.DEFAULT_GOAL :=
endif
-ifeq ($(.DEFAULT_GOAL),clean)
-.DEFAULT_GOAL :=
-endif
+# Make sure the distribution prefix is set if the goal is dist or dist-win.
+#
+ifneq ($(filter $(MAKECMDGOALS),dist dist-win),)
+ifeq ($(dist_prefix),)
+$(error dist_prefix is not set)
+endif
endif
-# Don't include dependency info if we are cleaning.
+# Don't include dependency info for certain targets.
#
define include-dep
-endef
-
-ifneq ($(MAKECMDGOALS),clean)
-ifneq ($(MAKECMDGOALS),disfigure)
-define include-dep
$(call -include,$1)
endef
+
+ifneq ($(filter $(MAKECMDGOALS),clean cleandoc disfigure),)
+include-dep =
endif
+
+
+# For dist, don't include dependecies in libxsde, examples, and tests.
+#
+ifneq ($(filter $(MAKECMDGOALS),dist dist-win),)
+
+ifneq ($(subst $(src_root)/libxsde/,,$(src_base)),$(src_base))
+include-dep =
+endif
+
+ifneq ($(subst $(src_root)/tests/,,$(src_base)),$(src_base))
+include-dep =
+endif
+
+ifneq ($(subst $(src_root)/examples/,,$(src_base)),$(src_base))
+include-dep =
+endif
+
endif