2011-05-01 15:18:52 -05:00
|
|
|
######################################################################
|
|
|
|
# Distribution
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
PKG_NAME := rust
|
2012-01-17 18:49:44 -06:00
|
|
|
PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
|
2011-05-01 15:18:52 -05:00
|
|
|
PKG_TAR = $(PKG_DIR).tar.gz
|
|
|
|
|
2011-07-23 14:26:47 -05:00
|
|
|
ifdef CFG_MAKENSIS
|
|
|
|
PKG_NSI = $(S)src/etc/pkg/rust.nsi
|
|
|
|
PKG_EXE = $(PKG_DIR)-install.exe
|
|
|
|
endif
|
|
|
|
|
2012-01-18 20:19:47 -06:00
|
|
|
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm
|
2011-10-05 19:41:01 -05:00
|
|
|
|
2012-01-18 19:25:54 -06:00
|
|
|
PKG_FILES := \
|
2012-01-17 18:49:44 -06:00
|
|
|
$(S)LICENSE.txt $(S)README.txt \
|
2011-05-01 15:18:52 -05:00
|
|
|
$(S)configure $(S)Makefile.in \
|
2012-01-18 19:25:54 -06:00
|
|
|
$(S)doc \
|
2011-05-01 15:18:52 -05:00
|
|
|
$(addprefix $(S)src/, \
|
2012-01-17 18:49:44 -06:00
|
|
|
README.txt \
|
2012-01-10 16:34:53 -06:00
|
|
|
cargo \
|
|
|
|
comp \
|
|
|
|
compiletest \
|
|
|
|
etc \
|
|
|
|
fuzzer \
|
|
|
|
libcore \
|
|
|
|
libstd \
|
|
|
|
rt \
|
|
|
|
rustdoc \
|
|
|
|
rustllvm \
|
|
|
|
snapshots.txt \
|
|
|
|
test) \
|
|
|
|
$(PKG_GITMODULES) \
|
2012-01-18 19:25:54 -06:00
|
|
|
$(filter-out Makefile config.mk, $(MKFILE_DEPS))
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2012-01-18 19:25:54 -06:00
|
|
|
UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES))
|
2011-07-23 14:26:47 -05:00
|
|
|
|
|
|
|
lic.txt: $(S)LICENSE.txt
|
|
|
|
@$(call E, crlf: $@)
|
2011-10-07 14:06:17 -05:00
|
|
|
@$(Q)perl -pe 's@\r\n|\n@\r\n@go' <$< >$@
|
2011-07-23 14:26:47 -05:00
|
|
|
|
2011-10-07 14:06:17 -05:00
|
|
|
$(PKG_EXE): $(PKG_NSI) $(PKG_FILES) $(DOCS) $(SREQ3$(CFG_HOST_TRIPLE)) lic.txt
|
2011-07-23 14:26:47 -05:00
|
|
|
@$(call E, makensis: $@)
|
|
|
|
$(Q)makensis -NOCD -V1 "-XOutFile $@" "-XLicenseData lic.txt" $<
|
|
|
|
$(Q)rm -f lic.txt
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-07-23 14:26:47 -05:00
|
|
|
$(PKG_TAR): $(PKG_FILES)
|
2011-05-01 15:18:52 -05:00
|
|
|
@$(call E, making dist dir)
|
|
|
|
$(Q)rm -Rf dist
|
|
|
|
$(Q)mkdir -p dist/$(PKG_DIR)
|
2012-01-19 12:52:04 -06: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 15:18:52 -05:00
|
|
|
$(Q)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
|
|
|
|
$(Q)rm -Rf dist
|
|
|
|
|
2012-01-17 18:49:44 -06:00
|
|
|
.PHONY: dist nsis-dist distcheck
|
|
|
|
|
2012-01-19 20:29:48 -06:00
|
|
|
ifdef CFG_WINDOWSY
|
|
|
|
|
|
|
|
dist: $(PKG_EXE)
|
|
|
|
|
|
|
|
|
|
|
|
distcheck: dist
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_EXE) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
dist: $(PKG_TAR)
|
2012-01-17 18:49:44 -06:00
|
|
|
|
|
|
|
nsis-dist: $(PKG_EXE)
|
|
|
|
|
2011-05-01 15:18:52 -05: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 16:34:53 -06:00
|
|
|
$(Q)+make -C dist/$(PKG_DIR)-build check
|
2011-05-01 15:18:52 -05:00
|
|
|
@$(call E, making 'clean' in dist/$(PKG_DIR)-build)
|
2012-01-10 16:34:53 -06:00
|
|
|
$(Q)+make -C dist/$(PKG_DIR)-build clean
|
2011-05-01 15:18:52 -05:00
|
|
|
$(Q)rm -Rf dist
|
|
|
|
@echo
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
@echo $(PKG_TAR) ready for distribution
|
|
|
|
@echo -----------------------------------------------
|
|
|
|
|
2012-01-19 20:29:48 -06:00
|
|
|
endif
|