2014-03-21 19:40:31 +01:00
|
|
|
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2011-05-01 22:18:52 +02:00
|
|
|
######################################################################
|
|
|
|
# Distribution
|
|
|
|
######################################################################
|
|
|
|
|
2014-03-21 19:40:31 +01:00
|
|
|
# Primary targets:
|
|
|
|
#
|
|
|
|
# * dist - make all distribution artifacts
|
|
|
|
# * distcheck - sanity check dist artifacts
|
|
|
|
# * dist-tar-src - source tarballs
|
|
|
|
# * dist-tar-bins - Ad-hoc Unix binary installers
|
2014-03-21 21:37:09 +01:00
|
|
|
# * dist-docs - Stage docs for upload
|
2014-03-21 19:40:31 +01:00
|
|
|
|
2014-03-26 01:54:26 +01:00
|
|
|
PKG_NAME := $(CFG_PACKAGE_NAME)
|
2015-10-13 02:24:30 +02:00
|
|
|
STD_PKG_NAME := rust-std-$(CFG_PACKAGE_VERS)
|
2014-12-29 20:15:40 +01:00
|
|
|
DOC_PKG_NAME := rust-docs-$(CFG_PACKAGE_VERS)
|
2014-12-30 01:47:21 +01:00
|
|
|
MINGW_PKG_NAME := rust-mingw-$(CFG_PACKAGE_VERS)
|
2016-07-09 14:33:03 +02:00
|
|
|
SRC_PKG_NAME := rust-src-$(CFG_PACKAGE_VERS)
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2014-03-22 03:20:44 +01:00
|
|
|
# License suitable for displaying in a popup
|
|
|
|
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
|
|
|
|
cat $^ > $@
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# Source tarball
|
|
|
|
######################################################################
|
|
|
|
|
2014-12-30 20:47:12 +01:00
|
|
|
PKG_TAR = dist/$(PKG_NAME)-src.tar.gz
|
2014-03-22 03:20:44 +01:00
|
|
|
|
2014-10-01 08:10:10 +02:00
|
|
|
PKG_GITMODULES := $(S)src/llvm $(S)src/compiler-rt \
|
2014-05-11 20:55:39 +02:00
|
|
|
$(S)src/rt/hoedown $(S)src/jemalloc
|
2012-01-19 02:25:54 +01:00
|
|
|
PKG_FILES := \
|
2012-12-07 23:39:40 +01:00
|
|
|
$(S)COPYRIGHT \
|
2012-12-07 23:37:01 +01:00
|
|
|
$(S)LICENSE-APACHE \
|
|
|
|
$(S)LICENSE-MIT \
|
2013-07-13 15:57:01 +02:00
|
|
|
$(S)CONTRIBUTING.md \
|
2012-12-07 23:37:01 +01:00
|
|
|
$(S)README.md \
|
2014-10-03 01:18:27 +02:00
|
|
|
$(S)RELEASES.md \
|
2011-05-01 22:18:52 +02:00
|
|
|
$(S)configure $(S)Makefile.in \
|
2012-01-20 21:06:14 +01:00
|
|
|
$(S)man \
|
2011-05-01 22:18:52 +02:00
|
|
|
$(addprefix $(S)src/, \
|
2016-02-21 03:34:07 +01:00
|
|
|
bootstrap \
|
|
|
|
build_helper \
|
2014-02-15 04:36:56 +01:00
|
|
|
doc \
|
2014-02-08 14:37:48 +01:00
|
|
|
driver \
|
2012-01-10 23:34:53 +01:00
|
|
|
etc \
|
2014-02-08 14:37:48 +01:00
|
|
|
$(foreach crate,$(CRATES),lib$(crate)) \
|
2015-03-11 05:58:16 +01:00
|
|
|
libcollectionstest \
|
2014-06-30 18:13:09 +02:00
|
|
|
libcoretest \
|
2014-03-31 06:13:25 +02:00
|
|
|
libbacktrace \
|
2012-01-10 23:34:53 +01:00
|
|
|
rt \
|
2015-11-02 17:45:38 +01:00
|
|
|
rtstartup \
|
2012-01-10 23:34:53 +01:00
|
|
|
rustllvm \
|
2016-02-21 03:34:07 +01:00
|
|
|
rustc \
|
2016-04-13 20:18:35 +02:00
|
|
|
stage0.txt \
|
2014-11-21 23:45:45 +01:00
|
|
|
rust-installer \
|
2016-03-12 21:22:40 +01:00
|
|
|
tools \
|
2016-11-01 21:46:38 +01:00
|
|
|
test \
|
|
|
|
vendor) \
|
2012-01-10 23:34:53 +01:00
|
|
|
$(PKG_GITMODULES) \
|
2014-03-21 23:15:45 +01:00
|
|
|
$(filter-out config.stamp, \
|
|
|
|
$(MKFILES_FOR_TARBALL))
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2012-01-19 02:25:54 +01:00
|
|
|
UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES))
|
2011-07-23 21:26:47 +02:00
|
|
|
|
2016-07-09 14:33:03 +02:00
|
|
|
tmp/dist/$$(SRC_PKG_NAME)-image: $(PKG_FILES)
|
|
|
|
@$(call E, making src image)
|
|
|
|
$(Q)rm -Rf tmp/dist/$(SRC_PKG_NAME)-image
|
|
|
|
$(Q)mkdir -p tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src/rust
|
2016-09-02 12:15:56 +02:00
|
|
|
$(Q)echo "$(CFG_VERSION)" > tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src/rust/version
|
2012-01-19 19:52:04 +01:00
|
|
|
$(Q)tar \
|
|
|
|
-C $(S) \
|
2016-05-05 06:41:49 +02:00
|
|
|
-f - \
|
2012-01-19 19:52:04 +01:00
|
|
|
--exclude-vcs \
|
|
|
|
--exclude=*~ \
|
2015-09-19 09:42:21 +02:00
|
|
|
--exclude=*.pyc \
|
2012-01-19 19:52:04 +01:00
|
|
|
--exclude=*/llvm/test/*/*.ll \
|
|
|
|
--exclude=*/llvm/test/*/*.td \
|
|
|
|
--exclude=*/llvm/test/*/*.s \
|
|
|
|
--exclude=*/llvm/test/*/*/*.ll \
|
|
|
|
--exclude=*/llvm/test/*/*/*.td \
|
|
|
|
--exclude=*/llvm/test/*/*/*.s \
|
2016-07-09 14:33:03 +02:00
|
|
|
-c $(UNROOTED_PKG_FILES) | tar -x -f - -C tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src/rust
|
|
|
|
|
|
|
|
$(PKG_TAR): tmp/dist/$$(SRC_PKG_NAME)-image
|
2014-03-31 09:05:41 +02:00
|
|
|
@$(call E, making $@)
|
2016-07-09 14:33:03 +02:00
|
|
|
$(Q)tar -czf $(PKG_TAR) -C tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src rust --transform 's,^rust,$(PKG_NAME),S'
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2014-03-21 19:40:31 +01:00
|
|
|
dist-tar-src: $(PKG_TAR)
|
2012-01-18 01:49:44 +01:00
|
|
|
|
2014-03-22 02:55:31 +01:00
|
|
|
distcheck-tar-src: dist-tar-src
|
2014-03-21 23:15:45 +01:00
|
|
|
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)
|
|
|
|
$(Q)rm -Rf tmp/distcheck/srccheck
|
|
|
|
$(Q)mkdir -p tmp/distcheck
|
|
|
|
@$(call E, unpacking $(PKG_TAR) in tmp/distcheck/$(PKG_NAME))
|
|
|
|
$(Q)cd tmp/distcheck && tar -xzf ../../$(PKG_TAR)
|
|
|
|
@$(call E, configuring in tmp/distcheck/srccheck)
|
|
|
|
$(Q)mkdir -p tmp/distcheck/srccheck
|
|
|
|
$(Q)cd tmp/distcheck/srccheck && ../$(PKG_NAME)/configure
|
|
|
|
@$(call E, making 'check' in tmp/distcheck/srccheck)
|
|
|
|
$(Q)+make -C tmp/distcheck/srccheck check
|
|
|
|
@$(call E, making 'clean' in tmp/distcheck/srccheck)
|
|
|
|
$(Q)+make -C tmp/distcheck/srccheck clean
|
|
|
|
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)
|
|
|
|
$(Q)rm -Rf tmp/distcheck/srccheck
|
|
|
|
|
|
|
|
|
2014-03-21 18:48:13 +01:00
|
|
|
######################################################################
|
|
|
|
# Unix binary installer tarballs
|
|
|
|
######################################################################
|
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
define DEF_START_INSTALLER
|
|
|
|
dist-install-dir-$(1)-%: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
|
|
|
|
dist-install-dir-$(1)-%: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
|
|
|
|
dist-install-dir-$(1)-%: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
|
|
|
|
dist-install-dir-$(1)-%: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
|
|
|
dist-install-dir-$(1)-%: PREPARE_CLEAN=true
|
2014-07-23 02:17:57 +02:00
|
|
|
|
|
|
|
$$(eval $$(call DEF_PREPARE,dir-$(1)))
|
2015-10-13 02:24:30 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach target,$(CFG_TARGET),\
|
|
|
|
$(eval $(call DEF_START_INSTALLER,$(target))))
|
2014-07-23 02:17:57 +02:00
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
define DEF_INSTALLER
|
|
|
|
|
|
|
|
dist-install-dir-$(1)-host: PREPARE_HOST=$(1)
|
|
|
|
dist-install-dir-$(1)-host: PREPARE_TARGETS=$(2)
|
|
|
|
dist-install-dir-$(1)-host: PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)-image
|
|
|
|
dist-install-dir-$(1)-host: prepare-base-dir-$(1)-host docs
|
2014-12-29 20:15:40 +01:00
|
|
|
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
|
|
|
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
|
|
|
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
|
|
|
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)/share/doc/rust
|
|
|
|
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)/share/doc/rust
|
2015-02-11 22:14:28 +01:00
|
|
|
|
|
|
|
prepare-overlay-$(1):
|
|
|
|
$$(Q)rm -Rf tmp/dist/$$(PKG_NAME)-$(1)-overlay
|
|
|
|
$$(Q)mkdir -p tmp/dist/$$(PKG_NAME)-$(1)-overlay
|
|
|
|
$$(Q)cp $$(S)COPYRIGHT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
|
|
|
|
$$(Q)cp $$(S)LICENSE-APACHE tmp/dist/$$(PKG_NAME)-$(1)-overlay/
|
|
|
|
$$(Q)cp $$(S)LICENSE-MIT tmp/dist/$$(PKG_NAME)-$(1)-overlay/
|
|
|
|
$$(Q)cp $$(S)README.md tmp/dist/$$(PKG_NAME)-$(1)-overlay/
|
2015-01-01 06:01:02 +01:00
|
|
|
# This tiny morsel of metadata is used by rust-packaging
|
2015-02-11 22:14:28 +01:00
|
|
|
$$(Q)echo "$(CFG_VERSION)" > tmp/dist/$$(PKG_NAME)-$(1)-overlay/version
|
2014-03-09 22:15:33 +01:00
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)-host prepare-overlay-$(1)
|
2014-03-09 22:15:33 +01:00
|
|
|
@$(call E, build: $$@)
|
2015-10-25 18:28:47 +01:00
|
|
|
# On a MinGW target we've got a few runtime DLL dependencies that we need
|
2015-10-13 02:24:30 +02:00
|
|
|
# to include. THe first argument to `make-win-dist` is where to put these DLLs
|
|
|
|
# (the image we're creating) and the second argument is a junk directory to
|
|
|
|
# ignore all the other MinGW stuff the script creates.
|
2015-10-25 18:28:47 +01:00
|
|
|
ifeq ($$(findstring pc-windows-gnu,$(1)),pc-windows-gnu)
|
2015-10-23 18:47:44 +02:00
|
|
|
$$(Q)rm -Rf tmp/dist/win-rust-gcc-$(1)
|
2015-10-13 02:24:30 +02:00
|
|
|
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py \
|
2015-10-23 18:47:44 +02:00
|
|
|
tmp/dist/$$(PKG_NAME)-$(1)-image \
|
|
|
|
tmp/dist/win-rust-gcc-$(1) $(1)
|
2015-10-13 02:24:30 +02:00
|
|
|
endif
|
|
|
|
# On 32-bit MinGW we're always including a DLL which needs some extra licenses
|
|
|
|
# to distribute. On 64-bit MinGW we don't actually distribute anything requiring
|
|
|
|
# us to distribute a license but it's likely that the install will *also*
|
|
|
|
# include the rust-mingw package down below, which also need licenses, so to be
|
|
|
|
# safe we just inlude it here in all MinGW packages.
|
2015-10-23 18:47:44 +02:00
|
|
|
ifdef CFG_WINDOWSY_$(1)
|
|
|
|
ifeq ($$(findstring $(1),gnu),gnu)
|
2015-10-13 02:24:30 +02:00
|
|
|
$$(Q)cp -r $$(S)src/etc/third-party \
|
2015-10-23 18:47:44 +02:00
|
|
|
tmp/dist/$$(PKG_NAME)-$(1)-image/share/doc/
|
2015-05-13 19:03:00 +02:00
|
|
|
endif
|
2014-12-30 01:47:21 +01:00
|
|
|
endif
|
2014-11-21 23:45:45 +01:00
|
|
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
|
|
|
--product-name=Rust \
|
|
|
|
--rel-manifest-dir=rustlib \
|
|
|
|
--success-message=Rust-is-ready-to-roll. \
|
|
|
|
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
|
|
|
|
--work-dir=tmp/dist \
|
|
|
|
--output-dir=dist \
|
2015-02-11 22:14:28 +01:00
|
|
|
--non-installed-overlay=tmp/dist/$$(PKG_NAME)-$(1)-overlay \
|
2014-12-12 03:05:05 +01:00
|
|
|
--package-name=$$(PKG_NAME)-$(1) \
|
|
|
|
--component-name=rustc \
|
|
|
|
--legacy-manifest-dirs=rustlib,cargo
|
2014-11-21 23:45:45 +01:00
|
|
|
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
|
2014-03-09 22:15:33 +01:00
|
|
|
|
2015-05-22 22:02:52 +02:00
|
|
|
dist-doc-install-dir-$(1): docs
|
2014-12-29 20:15:40 +01:00
|
|
|
$$(Q)mkdir -p tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust
|
|
|
|
$$(Q)cp -r doc tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust/html
|
|
|
|
|
|
|
|
dist/$$(DOC_PKG_NAME)-$(1).tar.gz: dist-doc-install-dir-$(1)
|
|
|
|
@$(call E, build: $$@)
|
|
|
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
|
|
|
--product-name=Rust-Documentation \
|
|
|
|
--rel-manifest-dir=rustlib \
|
|
|
|
--success-message=Rust-documentation-is-installed. \
|
|
|
|
--image-dir=tmp/dist/$$(DOC_PKG_NAME)-$(1)-image \
|
|
|
|
--work-dir=tmp/dist \
|
|
|
|
--output-dir=dist \
|
|
|
|
--package-name=$$(DOC_PKG_NAME)-$(1) \
|
|
|
|
--component-name=rust-docs \
|
|
|
|
--legacy-manifest-dirs=rustlib,cargo \
|
|
|
|
--bulk-dirs=share/doc/rust/html
|
|
|
|
$$(Q)rm -R tmp/dist/$$(DOC_PKG_NAME)-$(1)-image
|
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
# Creates the rust-mingw package, and the first argument to make-win-dist is a
|
|
|
|
# "temporary directory" which is just thrown away (this contains the runtime
|
|
|
|
# DLLs included in the rustc package above) and the second argument is where to
|
|
|
|
# place all the MinGW components (which is what we want).
|
2014-12-30 01:47:21 +01:00
|
|
|
dist-mingw-install-dir-$(1):
|
|
|
|
$$(Q)mkdir -p tmp/dist/rust-mingw-tmp-$(1)-image
|
|
|
|
$$(Q)rm -Rf tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image
|
|
|
|
$$(Q)$$(CFG_PYTHON) $$(S)src/etc/make-win-dist.py \
|
2015-10-13 02:24:30 +02:00
|
|
|
tmp/dist/rust-mingw-tmp-$(1)-image \
|
|
|
|
tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image $(1)
|
2014-12-30 01:47:21 +01:00
|
|
|
|
|
|
|
dist/$$(MINGW_PKG_NAME)-$(1).tar.gz: dist-mingw-install-dir-$(1)
|
|
|
|
@$(call E, build: $$@)
|
|
|
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
|
|
|
--product-name=Rust-MinGW \
|
|
|
|
--rel-manifest-dir=rustlib \
|
|
|
|
--success-message=Rust-MinGW-is-installed. \
|
|
|
|
--image-dir=tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image \
|
|
|
|
--work-dir=tmp/dist \
|
|
|
|
--output-dir=dist \
|
|
|
|
--package-name=$$(MINGW_PKG_NAME)-$(1) \
|
|
|
|
--component-name=rust-mingw \
|
|
|
|
--legacy-manifest-dirs=rustlib,cargo
|
|
|
|
$$(Q)rm -R tmp/dist/$$(MINGW_PKG_NAME)-$(1)-image
|
2014-12-29 20:15:40 +01:00
|
|
|
|
2014-03-02 06:38:13 +01:00
|
|
|
endef
|
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
# $(1) - host
|
|
|
|
# $(2) - target
|
|
|
|
define DEF_INSTALLER_TARGETS
|
2014-03-21 18:48:13 +01:00
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
dist-install-dir-$(2)-target: PREPARE_HOST=$(1)
|
|
|
|
dist-install-dir-$(2)-target: PREPARE_TARGETS=$(2)
|
|
|
|
dist-install-dir-$(2)-target: PREPARE_DEST_DIR=tmp/dist/$$(STD_PKG_NAME)-$(2)-image
|
|
|
|
dist-install-dir-$(2)-target: prepare-base-dir-$(2)-target
|
|
|
|
|
|
|
|
dist/$$(STD_PKG_NAME)-$(2).tar.gz: dist-install-dir-$(2)-target
|
|
|
|
@$$(call E, build: $$@)
|
|
|
|
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
|
|
|
|
--product-name=Rust \
|
|
|
|
--rel-manifest-dir=rustlib \
|
|
|
|
--success-message=std-is-standing-at-the-ready. \
|
|
|
|
--image-dir=tmp/dist/$$(STD_PKG_NAME)-$(2)-image \
|
|
|
|
--work-dir=tmp/dist \
|
|
|
|
--output-dir=dist \
|
|
|
|
--package-name=$$(STD_PKG_NAME)-$(2) \
|
|
|
|
--component-name=rust-std-$(2) \
|
|
|
|
--legacy-manifest-dirs=rustlib,cargo
|
|
|
|
$$(Q)rm -R tmp/dist/$$(STD_PKG_NAME)-$(2)-image
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST),\
|
|
|
|
$(eval $(call DEF_INSTALLER,$(host))))
|
2015-10-22 18:01:34 +02:00
|
|
|
|
2016-07-09 14:33:03 +02:00
|
|
|
dist/$(SRC_PKG_NAME).tar.gz: tmp/dist/$(SRC_PKG_NAME)-image
|
|
|
|
@$(call E, build: $@)
|
|
|
|
$(Q)$(S)src/rust-installer/gen-installer.sh \
|
|
|
|
--product-name=Rust \
|
|
|
|
--rel-manifest-dir=rustlib \
|
|
|
|
--success-message=Awesome-Source. \
|
|
|
|
--image-dir=tmp/dist/$(SRC_PKG_NAME)-image \
|
|
|
|
--work-dir=tmp/dist \
|
|
|
|
--output-dir=dist \
|
|
|
|
--package-name=$(SRC_PKG_NAME) \
|
|
|
|
--component-name=rust-src \
|
|
|
|
--legacy-manifest-dirs=rustlib,cargo
|
|
|
|
|
2015-10-22 18:01:34 +02:00
|
|
|
# When generating packages for the standard library, we've actually got a lot of
|
|
|
|
# artifacts to choose from. Each of the CFG_HOST compilers will have a copy of
|
|
|
|
# the standard library for each CFG_TARGET, but we only want to generate one
|
|
|
|
# standard library package. As a result, for each entry in CFG_TARGET we need to
|
|
|
|
# pick a CFG_HOST to get the standard library from.
|
|
|
|
#
|
|
|
|
# In theory it doesn't actually matter what host we choose as it should be the
|
|
|
|
# case that all hosts produce the same set of libraries for a target (regardless
|
|
|
|
# of the host itself). Currently there is a bug in the compiler, however, which
|
|
|
|
# means this is not the case (see #29228 and #29235). To solve the first of
|
|
|
|
# those bugs, we prefer to select a standard library from the host it was
|
|
|
|
# generated from, allowing plugins to work in more situations.
|
|
|
|
#
|
|
|
|
# For all CFG_TARGET entries in CFG_HOST, however, we just pick CFG_BUILD as the
|
|
|
|
# host we slurp up a standard library from.
|
|
|
|
$(foreach host,$(CFG_HOST),\
|
|
|
|
$(eval $(call DEF_INSTALLER_TARGETS,$(host),$(host))))
|
|
|
|
$(foreach target,$(filter-out $(CFG_HOST),$(CFG_TARGET)),\
|
2015-10-13 02:24:30 +02:00
|
|
|
$(eval $(call DEF_INSTALLER_TARGETS,$(CFG_BUILD),$(target))))
|
2014-03-21 23:15:45 +01:00
|
|
|
|
2014-12-30 01:47:21 +01:00
|
|
|
ifdef CFG_WINDOWSY_$(CFG_BUILD)
|
2015-05-13 19:03:00 +02:00
|
|
|
define BUILD_MINGW_TARBALL
|
|
|
|
ifeq ($$(findstring gnu,$(1)),gnu)
|
|
|
|
MAYBE_MINGW_TARBALLS += dist/$(MINGW_PKG_NAME)-$(1).tar.gz
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_HOST),\
|
|
|
|
$(eval $(call BUILD_MINGW_TARBALL,$(host))))
|
2014-12-30 01:47:21 +01:00
|
|
|
endif
|
|
|
|
|
2014-12-30 04:08:35 +01:00
|
|
|
ifeq ($(CFG_DISABLE_DOCS),)
|
|
|
|
MAYBE_DOC_TARBALLS=$(foreach host,$(CFG_HOST),dist/$(DOC_PKG_NAME)-$(host).tar.gz)
|
2014-12-29 20:15:40 +01:00
|
|
|
endif
|
2014-03-21 23:15:45 +01:00
|
|
|
|
2015-10-13 02:24:30 +02:00
|
|
|
dist-tar-bins: \
|
|
|
|
$(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz) \
|
|
|
|
$(foreach target,$(CFG_TARGET),dist/$(STD_PKG_NAME)-$(target).tar.gz) \
|
2014-12-30 04:08:35 +01:00
|
|
|
$(MAYBE_DOC_TARBALLS) $(MAYBE_MINGW_TARBALLS)
|
|
|
|
|
2014-03-21 23:15:45 +01:00
|
|
|
# Just try to run the compiler for the build host
|
|
|
|
distcheck-tar-bins: dist-tar-bins
|
|
|
|
@$(call E, checking binary tarball)
|
|
|
|
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)
|
|
|
|
$(Q)rm -Rf tmp/distcheck/tarbininstall
|
|
|
|
$(Q)mkdir -p tmp/distcheck
|
|
|
|
$(Q)cd tmp/distcheck && tar -xzf ../../dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz
|
|
|
|
$(Q)mkdir -p tmp/distcheck/tarbininstall
|
|
|
|
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall
|
2014-03-31 06:23:43 +02:00
|
|
|
$(Q)sh tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix=tmp/distcheck/tarbininstall --uninstall
|
2014-03-21 23:15:45 +01:00
|
|
|
$(Q)rm -Rf tmp/distcheck/$(PKG_NAME)-$(CFG_BUILD)
|
|
|
|
$(Q)rm -Rf tmp/distcheck/tarbininstall
|
2014-03-21 18:48:13 +01:00
|
|
|
|
2014-03-21 21:37:09 +01:00
|
|
|
######################################################################
|
|
|
|
# Docs
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
# Just copy the docs to a folder under dist with the appropriate name
|
|
|
|
# for uploading to S3
|
2015-05-22 22:02:52 +02:00
|
|
|
dist-docs: docs
|
2014-03-21 23:21:45 +01:00
|
|
|
$(Q) rm -Rf dist/doc
|
2014-03-21 21:37:09 +01:00
|
|
|
$(Q) mkdir -p dist/doc/
|
|
|
|
$(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS)
|
|
|
|
|
2014-03-24 21:13:12 +01:00
|
|
|
distcheck-docs: dist-docs
|
2014-03-21 21:37:09 +01:00
|
|
|
|
2014-03-21 18:48:13 +01:00
|
|
|
######################################################################
|
|
|
|
# Primary targets (dist, distcheck)
|
|
|
|
######################################################################
|
|
|
|
|
2016-07-09 14:33:03 +02:00
|
|
|
MAYBE_DIST_TAR_SRC=dist-tar-src dist/$(SRC_PKG_NAME).tar.gz
|
|
|
|
MAYBE_DISTCHECK_TAR_SRC=distcheck-tar-src dist/$(SRC_PKG_NAME).tar.gz
|
2014-03-21 18:48:13 +01:00
|
|
|
|
2014-03-31 09:05:41 +02:00
|
|
|
# FIXME #13224: On OS X don't produce tarballs simply because --exclude-vcs don't work.
|
|
|
|
# This is a huge hack because I just don't have time to figure out another solution.
|
|
|
|
ifeq ($(CFG_OSTYPE), apple-darwin)
|
|
|
|
MAYBE_DIST_TAR_SRC=
|
|
|
|
MAYBE_DISTCHECK_TAR_SRC=
|
2014-12-30 01:24:44 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Don't bother with source tarballs on windows just because we historically haven't.
|
|
|
|
ifeq ($(CFG_OSTYPE), pc-windows-gnu)
|
|
|
|
MAYBE_DIST_TAR_SRC=
|
|
|
|
MAYBE_DISTCHECK_TAR_SRC=
|
2014-03-31 09:05:41 +02:00
|
|
|
endif
|
|
|
|
|
2014-12-15 23:40:43 +01:00
|
|
|
ifneq ($(CFG_DISABLE_DOCS),)
|
|
|
|
MAYBE_DIST_DOCS=
|
|
|
|
MAYBE_DISTCHECK_DOCS=
|
|
|
|
else
|
|
|
|
MAYBE_DIST_DOCS=dist-docs
|
|
|
|
MAYBE_DISTCHECK_DOCS=distcheck-docs
|
|
|
|
endif
|
|
|
|
|
2015-01-03 05:44:07 +01:00
|
|
|
dist: $(MAYBE_DIST_TAR_SRC) dist-tar-bins $(MAYBE_DIST_DOCS)
|
2014-03-21 18:48:13 +01:00
|
|
|
|
2015-01-03 05:44:07 +01:00
|
|
|
distcheck: $(MAYBE_DISTCHECK_TAR_SRC) distcheck-tar-bins $(MAYBE_DISTCHECK_DOCS)
|
2014-03-21 23:15:45 +01:00
|
|
|
$(Q)rm -Rf tmp/distcheck
|
2014-03-21 18:48:13 +01:00
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
2014-03-21 23:21:45 +01:00
|
|
|
@echo "Rust ready for distribution (see ./dist)"
|
2014-03-21 18:48:13 +01:00
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
|
|
|
.PHONY: dist distcheck
|