1 ######################################################################
3 ######################################################################
7 PKG_VER = $(shell date +"%Y-%m-%d")-snap
8 PKG_DIR = $(PKG_NAME)-$(PKG_VER)
9 PKG_TAR = $(PKG_DIR).tar.gz
12 PKG_NSI = $(S)src/etc/pkg/rust.nsi
13 PKG_EXE = $(PKG_DIR)-install.exe
16 PKG_3RDPARTY := rt/valgrind.h rt/memcheck.h \
17 rt/isaac/rand.h rt/isaac/standard.h \
18 rt/uthash/uthash.h rt/uthash/utlist.h \
19 rt/bigint/bigint.h rt/bigint/bigint_int.cpp \
20 rt/bigint/bigint_ext.cpp rt/bigint/low_primes.h
23 $(wildcard $(S)src/rt/libuv/*) \
24 $(wildcard $(S)src/rt/libuv/include/*) \
25 $(wildcard $(S)src/rt/libuv/include/*/*) \
26 $(wildcard $(S)src/rt/libuv/src/*) \
27 $(wildcard $(S)src/rt/libuv/src/*/*) \
28 $(wildcard $(S)src/rt/libuv/src/*/*/*)
30 PKG_PP_EXAMPLES = $(wildcard $(S)src/test/pretty/*.pp)
33 $(wildcard $(S)src/etc/*.*) \
34 $(S)LICENSE.txt $(S)README \
35 $(S)configure $(S)Makefile.in \
36 $(S)src/snapshots.txt \
37 $(addprefix $(S)src/, \
39 $(RUNTIME_CS) $(RUNTIME_HDR) \
42 rt/intrinsics/intrinsics.ll.in \
44 $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \
46 rustllvm/rustllvm.def.in \
54 $(COMPILETEST_CRATE) \
55 $(COMPILETEST_INPUTS) \
59 dist: $(PKG_TAR) $(PKG_EXE)
63 lic.txt: $(S)LICENSE.txt
65 @$(Q)perl -pe 's@\r\n|\n@\r\n@go' <$< >$@
67 $(PKG_EXE): $(PKG_NSI) $(PKG_FILES) $(DOCS) $(SREQ3$(CFG_HOST_TRIPLE)) lic.txt
68 @$(call E, makensis: $@)
69 $(Q)makensis -NOCD -V1 "-XOutFile $@" "-XLicenseData lic.txt" $<
72 $(PKG_TAR): $(PKG_FILES)
73 @$(call E, making dist dir)
75 $(Q)mkdir -p dist/$(PKG_DIR)
76 $(Q)tar -c $(PKG_FILES) | tar -x -C dist/$(PKG_DIR)
77 $(Q)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
83 @$(call E, unpacking $(PKG_TAR) in dist/$(PKG_DIR))
84 $(Q)cd dist && tar -xzf ../$(PKG_TAR)
85 @$(call E, configuring in dist/$(PKG_DIR)-build)
86 $(Q)mkdir -p dist/$(PKG_DIR)-build
87 $(Q)cd dist/$(PKG_DIR)-build && ../$(PKG_DIR)/configure
88 @$(call E, making 'check' in dist/$(PKG_DIR)-build)
89 $(Q)make -C dist/$(PKG_DIR)-build check
90 @$(call E, making 'clean' in dist/$(PKG_DIR)-build)
91 $(Q)make -C dist/$(PKG_DIR)-build clean
94 @echo -----------------------------------------------
95 @echo $(PKG_TAR) ready for distribution
96 @echo -----------------------------------------------