2011-05-01 20:18:52 +00:00
|
|
|
######################################################################
|
|
|
|
# Distribution
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
PKG_NAME := rust
|
2012-01-18 00:49:44 +00:00
|
|
|
PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
|
2011-05-01 20:18:52 +00:00
|
|
|
PKG_TAR = $(PKG_DIR).tar.gz
|
|
|
|
|
2012-01-26 00:02:53 +00:00
|
|
|
ifdef CFG_ISCC
|
|
|
|
PKG_ISS = $(wildcard $(S)src/etc/pkg/*.iss)
|
|
|
|
PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
|
2011-07-23 19:26:47 +00:00
|
|
|
PKG_EXE = $(PKG_DIR)-install.exe
|
|
|
|
endif
|
|
|
|
|
2014-02-25 16:47:58 +00:00
|
|
|
ifeq ($(CFG_OSTYPE), apple-darwin)
|
|
|
|
PKG_OSX = $(PKG_DIR).pkg
|
|
|
|
endif
|
|
|
|
|
2014-02-12 19:42:58 +00:00
|
|
|
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
|
2011-10-06 00:41:01 +00:00
|
|
|
|
2012-01-19 01:25:54 +00:00
|
|
|
PKG_FILES := \
|
2012-12-07 22:39:40 +00:00
|
|
|
$(S)COPYRIGHT \
|
2012-12-07 22:37:01 +00:00
|
|
|
$(S)LICENSE-APACHE \
|
|
|
|
$(S)LICENSE-MIT \
|
2013-04-08 08:15:12 +00:00
|
|
|
$(S)AUTHORS.txt \
|
2013-07-13 13:57:01 +00:00
|
|
|
$(S)CONTRIBUTING.md \
|
2012-12-07 22:37:01 +00:00
|
|
|
$(S)README.md \
|
2013-07-13 13:57:01 +00:00
|
|
|
$(S)RELEASES.txt \
|
2011-05-01 20:18:52 +00:00
|
|
|
$(S)configure $(S)Makefile.in \
|
2012-01-20 20:06:14 +00:00
|
|
|
$(S)man \
|
2011-05-01 20:18:52 +00:00
|
|
|
$(addprefix $(S)src/, \
|
2014-02-08 13:07:02 +00:00
|
|
|
README.md \
|
2012-01-10 22:34:53 +00:00
|
|
|
compiletest \
|
2014-02-15 03:36:56 +00:00
|
|
|
doc \
|
2014-02-08 13:37:48 +00:00
|
|
|
driver \
|
2012-01-10 22:34:53 +00:00
|
|
|
etc \
|
2014-02-08 13:37:48 +00:00
|
|
|
$(foreach crate,$(CRATES),lib$(crate)) \
|
2012-01-10 22:34:53 +00:00
|
|
|
rt \
|
|
|
|
rustllvm \
|
|
|
|
snapshots.txt \
|
|
|
|
test) \
|
|
|
|
$(PKG_GITMODULES) \
|
2012-03-28 18:29:38 +00:00
|
|
|
$(filter-out Makefile config.stamp config.mk, \
|
|
|
|
$(MKFILE_DEPS))
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2012-01-19 01:25:54 +00:00
|
|
|
UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES))
|
2011-07-23 19:26:47 +00:00
|
|
|
|
2012-12-08 02:45:27 +00:00
|
|
|
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
|
|
|
|
cat $^ > $@
|
2011-07-23 19:26:47 +00:00
|
|
|
|
2014-02-25 16:47:58 +00:00
|
|
|
ifdef CFG_ISCC
|
2012-01-26 00:02:53 +00:00
|
|
|
%.iss: $(S)src/etc/pkg/%.iss
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
%.ico: $(S)src/etc/pkg/%.ico
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
|
2014-02-13 08:22:18 +00:00
|
|
|
$(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
|
|
|
|
dist-prepare-win
|
|
|
|
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin
|
2012-01-26 00:02:53 +00:00
|
|
|
@$(call E, ISCC: $@)
|
|
|
|
$(Q)"$(CFG_ISCC)" $<
|
2011-05-01 20:18:52 +00:00
|
|
|
|
2014-02-13 08:22:18 +00:00
|
|
|
dist-prepare-win: PREPARE_HOST=$(CFG_BUILD)
|
|
|
|
dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD)
|
|
|
|
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win
|
|
|
|
# On windows we're using stage3, unlike Unix...
|
|
|
|
dist-prepare-win: PREPARE_STAGE=3
|
|
|
|
dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
|
|
|
|
dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
|
|
|
|
dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
|
|
|
|
dist-prepare-win: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
2014-03-02 05:38:13 +00:00
|
|
|
dist-prepare-win: PREPARE_CLEAN=true
|
2014-02-13 08:22:18 +00:00
|
|
|
dist-prepare-win: prepare-base
|
|
|
|
|
|
|
|
endif
|
2012-01-26 00:02:53 +00:00
|
|
|
|
2011-07-23 19:26:47 +00:00
|
|
|
$(PKG_TAR): $(PKG_FILES)
|
2011-05-01 20:18:52 +00:00
|
|
|
@$(call E, making dist dir)
|
|
|
|
$(Q)rm -Rf dist
|
|
|
|
$(Q)mkdir -p dist/$(PKG_DIR)
|
2012-01-19 18:52:04 +00:00
|
|
|
$(Q)tar \
|
|
|
|
-C $(S) \
|
|
|
|
--exclude-vcs \
|
|
|
|
--exclude=*~ \
|
|
|
|
--exclude=*/llvm/test/*/*.ll \
|
|
|
|
--exclude=*/llvm/test/*/*.td \
|
|
|
|
--exclude=*/llvm/test/*/*.s \
|
|
|
|
--exclude=*/llvm/test/*/*/*.ll \
|
|
|
|
--exclude=*/llvm/test/*/*/*.td \
|
|
|
|
--exclude=*/llvm/test/*/*/*.s \
|
|
|
|
-c $(UNROOTED_PKG_FILES) | tar -x -C dist/$(PKG_DIR)
|
2011-05-01 20:18:52 +00:00
|
|
|
$(Q)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
|
|
|
|
$(Q)rm -Rf dist
|
|
|
|
|
2012-01-26 00:02:53 +00:00
|
|
|
.PHONY: dist distcheck
|
2012-01-18 00:49:44 +00:00
|
|
|
|
2013-10-21 09:18:21 +00:00
|
|
|
ifdef CFG_WINDOWSY_$(CFG_BUILD)
|
2012-01-20 02:29:48 +00:00
|
|
|
|
|
|
|
dist: $(PKG_EXE)
|
|
|
|
|
|
|
|
distcheck: dist
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_EXE) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2014-02-26 16:59:58 +00:00
|
|
|
dist: $(PKG_TAR) $(PKG_OSX)
|
2012-01-18 00:49:44 +00:00
|
|
|
|
2011-05-01 20:18:52 +00:00
|
|
|
distcheck: $(PKG_TAR)
|
|
|
|
$(Q)rm -Rf dist
|
|
|
|
$(Q)mkdir -p dist
|
|
|
|
@$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR))
|
|
|
|
$(Q)cd dist && tar -xzf ../$(PKG_TAR)
|
|
|
|
@$(call E, configuring in dist/$(PKG_DIR)-build)
|
|
|
|
$(Q)mkdir -p dist/$(PKG_DIR)-build
|
|
|
|
$(Q)cd dist/$(PKG_DIR)-build && ../$(PKG_DIR)/configure
|
|
|
|
@$(call E, making 'check' in dist/$(PKG_DIR)-build)
|
2012-01-10 22:34:53 +00:00
|
|
|
$(Q)+make -C dist/$(PKG_DIR)-build check
|
2011-05-01 20:18:52 +00:00
|
|
|
@$(call E, making 'clean' in dist/$(PKG_DIR)-build)
|
2012-01-10 22:34:53 +00:00
|
|
|
$(Q)+make -C dist/$(PKG_DIR)-build clean
|
2011-05-01 20:18:52 +00:00
|
|
|
$(Q)rm -Rf dist
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_TAR) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
2012-01-20 02:29:48 +00:00
|
|
|
endif
|
2014-02-25 16:47:58 +00:00
|
|
|
|
|
|
|
ifeq ($(CFG_OSTYPE), apple-darwin)
|
|
|
|
|
|
|
|
dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD)
|
|
|
|
dist-prepare-osx: PREPARE_TARGETS=$(CFG_BUILD)
|
2014-02-26 16:59:58 +00:00
|
|
|
dist-prepare-osx: PREPARE_DEST_DIR=tmp/dist/pkgroot
|
2014-02-25 16:47:58 +00:00
|
|
|
dist-prepare-osx: PREPARE_STAGE=2
|
|
|
|
dist-prepare-osx: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
|
|
|
|
dist-prepare-osx: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
|
|
|
|
dist-prepare-osx: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
|
|
|
|
dist-prepare-osx: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
|
|
|
dist-prepare-osx: prepare-base
|
|
|
|
|
|
|
|
$(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx
|
|
|
|
@$(call E, making OS X pkg)
|
2014-02-26 16:59:58 +00:00
|
|
|
$(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot rust.pkg
|
2014-02-25 16:47:58 +00:00
|
|
|
$(Q)productbuild --distribution Distribution.xml --resources . $(PKG_OSX)
|
2014-02-26 16:59:58 +00:00
|
|
|
$(Q)rm -rf tmp rust.pkg
|
2014-02-25 16:47:58 +00:00
|
|
|
|
|
|
|
dist-osx: $(PKG_OSX)
|
|
|
|
|
|
|
|
distcheck-osx: $(PKG_OSX)
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_OSX) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
|
|
|
endif
|
2014-03-02 05:38:13 +00:00
|
|
|
|
|
|
|
dist-installer: $(foreach host,$(CFG_HOST),dist-installer-$(host))
|
|
|
|
|
|
|
|
define DEF_INSTALLER
|
|
|
|
dist-installer-$(1): PREPARE_HOST=$(1)
|
|
|
|
dist-installer-$(1): PREPARE_TARGETS=$(1)
|
|
|
|
dist-installer-$(1): PREPARE_STAGE=2
|
|
|
|
dist-installer-$(1): PREPARE_DEST_DIR=tmp/dist/installer-$(1)
|
|
|
|
dist-installer-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
|
|
|
|
dist-installer-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
|
|
|
|
dist-installer-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
|
|
|
|
dist-installer-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
|
|
|
dist-installer-$(1): PREPARE_CLEAN=true
|
|
|
|
dist-installer-$(1): prepare-base
|
|
|
|
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find -type f) \
|
|
|
|
> $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/$$(CFG_RUSTLIBDIR)/manifest
|
|
|
|
$$(Q)cp $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST),\
|
|
|
|
$(eval $(call DEF_INSTALLER,$(host))))
|