# * dist-osx - OS X .pkg installers
# * dist-tar-bins - Ad-hoc Unix binary installers
-PKG_NAME := rust
-PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
-PKG_TAR = dist/$(PKG_DIR).tar.gz
+PKG_NAME = $(CFG_PACKAGE_NAME)
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
# Source tarball
######################################################################
+PKG_TAR = dist/$(PKG_NAME).tar.gz
+
$(PKG_TAR): $(PKG_FILES)
@$(call E, making dist dir)
- $(Q)rm -Rf tmp/dist/$(PKG_DIR)
- $(Q)mkdir -p tmp/dist/$(PKG_DIR)
+ $(Q)rm -Rf tmp/dist/$(PKG_NAME)
+ $(Q)mkdir -p tmp/dist/$(PKG_NAME)
$(Q)tar \
-C $(S) \
--exclude-vcs \
--exclude=*/llvm/test/*/*/*.ll \
--exclude=*/llvm/test/*/*/*.td \
--exclude=*/llvm/test/*/*/*.s \
- -c $(UNROOTED_PKG_FILES) | tar -x -C tmp/dist/$(PKG_DIR)
- $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_DIR)
- $(Q)rm -Rf tmp/dist/$(PKG_DIR)
+ -c $(UNROOTED_PKG_FILES) | tar -x -C tmp/dist/$(PKG_NAME)
+ $(Q)tar -czf $(PKG_TAR) -C tmp/dist $(PKG_NAME)
+ $(Q)rm -Rf tmp/dist/$(PKG_NAME)
dist-tar-src: $(PKG_TAR)
ifdef CFG_ISCC
-PKG_EXE = dist/$(PKG_DIR)-install.exe
+PKG_EXE = dist/$(PKG_NAME)-install.exe
%.iss: $(S)src/etc/pkg/%.iss
cp $< $@
dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
dist-prepare-osx-$(1): prepare-base
-dist/$(PKG_DIR)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1)
+dist/$(PKG_NAME)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1)
@$$(call E, making OS X pkg)
$(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot-$(1) rust.pkg
- $(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_DIR)-$(1).pkg
+ $(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_NAME)-$(1).pkg
$(Q)rm -rf tmp rust.pkg
endef
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host))))
-dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).pkg)
+dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).pkg)
endif
dist-install-dirs: $(foreach host,$(CFG_HOST),dist-install-dir-$(host))
-dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).tar.gz)
+dist-tar-bins: $(foreach host,$(CFG_HOST),dist/$(PKG_NAME)-$(host).tar.gz)
define DEF_INSTALLER
dist-install-dir-$(1): PREPARE_HOST=$(1)
dist-install-dir-$(1): PREPARE_TARGETS=$(1)
-dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_DIR)-$(1)
+dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
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)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
-dist/$$(PKG_DIR)-$(1).tar.gz: dist-install-dir-$(1)
+dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
@$(call E, build: $$@)
- $$(Q)tar -czf dist/$$(PKG_DIR)-$(1).tar.gz -C tmp/dist $$(PKG_DIR)-$(1)
+ $$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
endef
distcheck: $(PKG_TAR)
$(Q)rm -Rf dist
$(Q)mkdir -p dist
- @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR))
+ @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_NAME))
$(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)
- $(Q)+make -C dist/$(PKG_DIR)-build check
- @$(call E, making 'clean' in dist/$(PKG_DIR)-build)
- $(Q)+make -C dist/$(PKG_DIR)-build clean
+ @$(call E, configuring in dist/$(PKG_NAME)-build)
+ $(Q)mkdir -p dist/$(PKG_NAME)-build
+ $(Q)cd dist/$(PKG_NAME)-build && ../$(PKG_NAME)/configure
+ @$(call E, making 'check' in dist/$(PKG_NAME)-build)
+ $(Q)+make -C dist/$(PKG_NAME)-build check
+ @$(call E, making 'clean' in dist/$(PKG_NAME)-build)
+ $(Q)+make -C dist/$(PKG_NAME)-build clean
$(Q)rm -Rf dist
@echo
@echo -----------------------------------------------
######################################################################
# The version number
-CFG_RELEASE = 0.10-pre
+CFG_RELEASE_NUM=0.10
+CFG_RELEASE_LABEL=-pre
-# The version string plus commit information
+ifndef CFG_NIGHTLY
+# This is the normal version string
+CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)
+CFG_PACKAGE_VERS=$(CFG_RELEASE)
+else
+# Modify the version label for nightly builds
+CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)-nightly
+# When building nightly distributables just reuse the same "rust-nightly" name
+# so when we upload we'll always override the previous nighly. This doesn't actually
+# impact the version reported by rustc - it's just for file naming.
+CFG_PACKAGE_VERS=nightly
+endif
+# The name of the package to use for creating tarballs, installers etc.
+CFG_PACKAGE_NAME=rust-$(CFG_PACKAGE_VERS)
+
+# The version string plus commit information - this is what rustc reports
CFG_VERSION = $(CFG_RELEASE)
CFG_GIT_DIR := $(CFG_SRC_DIR).git
# since $(CFG_GIT) may contain spaces (especially on Windows),
endif
endif
-# windows exe's need numeric versions - don't use anything but
+# Windows exe's need numeric versions - don't use anything but
# numbers and dots here
-CFG_VERSION_WIN = $(subst -pre,,$(CFG_RELEASE))
+CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
######################################################################
export CFG_VERSION
export CFG_VERSION_WIN
export CFG_RELEASE
+export CFG_PACKAGE_NAME
export CFG_BUILD
export CFG_LLVM_ROOT
export CFG_ENABLE_MINGW_CROSS