rust/mk/dist.mk

119 lines
3.6 KiB
Makefile
Raw Normal View History

2011-05-01 20:18:52 +00:00
######################################################################
# Distribution
######################################################################
PKG_NAME := rust
PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
2011-05-01 20:18:52 +00:00
PKG_TAR = $(PKG_DIR).tar.gz
ifdef CFG_ISCC
PKG_ISS = $(wildcard $(S)src/etc/pkg/*.iss)
PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
PKG_EXE = $(PKG_DIR)-install.exe
endif
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm
2011-10-06 00:41:01 +00:00
2012-01-19 01:25:54 +00:00
PKG_FILES := \
$(S)COPYRIGHT \
2012-12-07 22:37:01 +00:00
$(S)LICENSE-APACHE \
$(S)LICENSE-MIT \
$(S)README.md \
2011-05-01 20:18:52 +00:00
$(S)configure $(S)Makefile.in \
2012-01-20 20:06:14 +00:00
$(S)man \
2012-01-19 01:25:54 +00:00
$(S)doc \
2011-05-01 20:18:52 +00:00
$(addprefix $(S)src/, \
README.txt \
2012-12-06 20:08:58 +00:00
driver \
librustpkg \
2012-12-06 19:55:56 +00:00
librusti \
librust \
2012-12-06 19:55:56 +00:00
librustc \
2012-01-10 22:34:53 +00:00
compiletest \
etc \
2012-12-06 19:55:56 +00:00
libfuzzer \
2012-01-10 22:34:53 +00:00
libcore \
libsyntax \
2012-01-10 22:34:53 +00:00
libstd \
rt \
2012-12-06 19:55:56 +00:00
librustdoc \
2012-01-10 22:34:53 +00:00
rustllvm \
snapshots.txt \
test) \
$(PKG_GITMODULES) \
$(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))
ifdef CFG_ISCC
2012-12-08 02:45:27 +00:00
LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
cat $^ > $@
%.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 \
$(PKG_FILES) all rustc-stage3
@$(call E, ISCC: $@)
$(Q)"$(CFG_ISCC)" $<
2012-01-20 05:27:14 +00:00
endif
2011-05-01 20:18:52 +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)
$(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
.PHONY: dist distcheck
2013-03-07 06:36:20 +00:00
ifdef CFG_WINDOWSY_$(CFG_BUILD_TRIPLE)
2012-01-20 02:29:48 +00:00
dist: $(PKG_EXE)
distcheck: dist
@echo
@echo -----------------------------------------------
@echo $(PKG_EXE) ready for distribution
@echo -----------------------------------------------
else
dist: $(PKG_TAR)
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