Skip to content

Commit ce2cbaa

Browse files
committed
---
yaml --- r: 108414 b: refs/heads/dist-snap c: 66bed17 h: refs/heads/master v: v3
1 parent 04ecf1e commit ce2cbaa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1108
-2391
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 54bccc5862512340870d0fed89458b29f3a3fcc0
9+
refs/heads/dist-snap: 66bed17641a348ec4f531135c33c6e76eb11527f
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/Makefile.in

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ include $(CFG_SRC_DIR)mk/llvm.mk
198198
# Secondary makefiles, conditionalized for speed
199199
######################################################################
200200

201+
# Source and binary distribution artifacts
202+
ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
203+
$(findstring check,$(MAKECMDGOALS)) \
204+
$(findstring test,$(MAKECMDGOALS)) \
205+
$(findstring tidy,$(MAKECMDGOALS)) \
206+
$(findstring clean,$(MAKECMDGOALS))),)
207+
CFG_INFO := $(info cfg: including dist rules)
208+
include $(CFG_SRC_DIR)mk/dist.mk
209+
endif
210+
201211
# Binary snapshots
202212
ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
203213
$(findstring clean,$(MAKECMDGOALS))),)
@@ -220,33 +230,18 @@ ifneq ($(findstring perf,$(MAKECMDGOALS)),)
220230
include $(CFG_SRC_DIR)mk/perf.mk
221231
endif
222232

223-
# Copy all the distributables to another directory for binary install
224-
ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
225-
$(findstring dist,$(MAKECMDGOALS)) \
226-
$(findstring install,$(MAKECMDGOALS))),)
227-
CFG_INFO := $(info cfg: including prepare rules)
228-
include $(CFG_SRC_DIR)mk/prepare.mk
233+
# Cleaning
234+
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
235+
CFG_INFO := $(info cfg: including clean rules)
236+
include $(CFG_SRC_DIR)mk/clean.mk
229237
endif
230238

231-
# (Unix) Installation from the build directory
239+
# Installation from the build directory
232240
ifneq ($(findstring install,$(MAKECMDGOALS)),)
233241
CFG_INFO := $(info cfg: including install rules)
234242
include $(CFG_SRC_DIR)mk/install.mk
235243
endif
236244

237-
# Source and binary distribution artifacts
238-
ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
239-
$(findstring clean,$(MAKECMDGOALS))),)
240-
CFG_INFO := $(info cfg: including dist rules)
241-
include $(CFG_SRC_DIR)mk/dist.mk
242-
endif
243-
244-
# Cleaning
245-
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
246-
CFG_INFO := $(info cfg: including clean rules)
247-
include $(CFG_SRC_DIR)mk/clean.mk
248-
endif
249-
250245
# CTAGS building
251246
ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
252247
$(findstring TAGS.vi,$(MAKECMDGOALS))),)

branches/dist-snap/mk/dist.mk

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ PKG_FILES := \
2424
$(S)RELEASES.txt \
2525
$(S)configure $(S)Makefile.in \
2626
$(S)man \
27+
$(S)doc \
2728
$(addprefix $(S)src/, \
2829
README.md \
2930
compiletest \
30-
doc \
3131
driver \
3232
etc \
3333
$(foreach crate,$(CRATES),lib$(crate)) \
@@ -52,25 +52,13 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
5252
cp $< $@
5353

5454
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
55-
$(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
56-
dist-prepare-win
57-
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin
55+
$(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD))
56+
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py i686-pc-mingw32/stage3/bin
5857
@$(call E, ISCC: $@)
5958
$(Q)"$(CFG_ISCC)" $<
60-
61-
dist-prepare-win: PREPARE_HOST=$(CFG_BUILD)
62-
dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD)
63-
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win
64-
# On windows we're using stage3, unlike Unix...
65-
dist-prepare-win: PREPARE_STAGE=3
66-
dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
67-
dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
68-
dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
69-
dist-prepare-win: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
70-
dist-prepare-win: prepare-base
71-
7259
endif
7360

61+
7462
$(PKG_TAR): $(PKG_FILES)
7563
@$(call E, making dist dir)
7664
$(Q)rm -Rf dist

branches/dist-snap/mk/install.mk

Lines changed: 137 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,117 @@
1212
# For consistency it might be desirable for stageN to be an exact
1313
# mirror of the installation directory structure.
1414

15+
# Installation macros.
16+
# For INSTALL,
17+
# $(1) is the source dirctory
18+
# $(2) is the destination directory
19+
# $(3) is the filename/libname-glob
20+
ifdef VERBOSE
21+
INSTALL = install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
22+
else
23+
INSTALL = $(Q)$(call E, install: $(DESTDIR)$(2)/$(3)) && install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
24+
endif
25+
26+
# For MK_INSTALL_DIR
27+
# $(1) is the directory to create
28+
MK_INSTALL_DIR = (umask 022 && mkdir -p $(DESTDIR)$(1))
29+
30+
# For INSTALL_LIB,
31+
# Target-specific $(LIB_SOURCE_DIR) is the source directory
32+
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
33+
# $(1) is the filename/libname-glob
34+
ifdef VERBOSE
35+
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
36+
else
37+
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(DESTDIR)$(LIB_DESTIN_DIR)/$(1)) && \
38+
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
39+
endif
40+
41+
# Target-specific $(LIB_SOURCE_DIR) is the source directory
42+
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
43+
# $(1) is the filename/libname-glob
44+
define INSTALL_LIB
45+
$(if $(filter-out 1,$(words $(wildcard $(LIB_SOURCE_DIR)/$(1)))), \
46+
$(error Aborting install because more than one library matching \
47+
$(1) is present in build tree $(LIB_SOURCE_DIR): \
48+
$(wildcard $(LIB_SOURCE_DIR)/$(1))))
49+
$(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1))))"; \
50+
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
51+
$(wildcard $(LIB_DESTIN_DIR)/$(1)))"; \
52+
if [ -n "$$MATCHES" ]; then \
53+
echo "warning: one or libraries matching Rust library '$(1)'" && \
54+
echo " (other than '$$LIB_NAME' itself) already present" && \
55+
echo " at destination $(LIB_DESTIN_DIR):" && \
56+
echo $$MATCHES ; \
57+
fi
58+
$(call DO_INSTALL_LIB,$(1))
59+
endef
60+
1561
# The stage we install from
1662
ISTAGE = 2
1763

18-
install: PREPARE_HOST=$(CFG_BUILD)
19-
install: PREPARE_TARGETS=$(CFG_TARGET)
20-
install: PREPARE_STAGE=$(ISTAGE)
21-
install: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
22-
install: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
23-
install: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
24-
install: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
25-
install: PREPARE_SOURCE_DIR=$(PREPARE_HOST)/stage$(PREPARE_STAGE)
26-
install: PREPARE_SOURCE_BIN_DIR=$(PREPARE_SOURCE_DIR)/bin
27-
install: PREPARE_SOURCE_LIB_DIR=$(PREPARE_SOURCE_DIR)/$(CFG_LIBDIR_RELATIVE)
28-
install: PREPARE_SOURCE_MAN_DIR=$(S)/man
29-
install: PREPARE_DEST_BIN_DIR=$(DESTDIR)$(CFG_PREFIX)/bin
30-
install: PREPARE_DEST_LIB_DIR=$(DESTDIR)$(CFG_LIBDIR)
31-
install: PREPARE_DEST_MAN_DIR=$(DESTDIR)$(CFG_MANDIR)/man1
32-
install: prepare-everything
33-
34-
35-
# Uninstall code
36-
3764
PREFIX_ROOT = $(CFG_PREFIX)
3865
PREFIX_BIN = $(PREFIX_ROOT)/bin
3966
PREFIX_LIB = $(CFG_LIBDIR)
4067

41-
INSTALL_TOOLS := $(PREPARE_TOOLS)
68+
INSTALL_TOOLS := $(filter-out compiletest, $(TOOLS))
69+
70+
define INSTALL_PREPARE_N
71+
# $(1) is the target triple
72+
# $(2) is the host triple
73+
74+
# T{B,L} == Target {Bin, Lib} for stage ${ISTAGE}
75+
TB$(1)$(2) = $$(TBIN$$(ISTAGE)_T_$(1)_H_$(2))
76+
TL$(1)$(2) = $$(TLIB$$(ISTAGE)_T_$(1)_H_$(2))
77+
78+
# PT{R,B,L} == Prefix Target {Root, Bin, Lib}
79+
PTR$(1)$(2) = $$(PREFIX_LIB)/$(CFG_RUSTLIBDIR)/$(1)
80+
PTB$(1)$(2) = $$(PTR$(1)$(2))/bin
81+
PTL$(1)$(2) = $$(PTR$(1)$(2))/lib
82+
83+
endef
84+
85+
$(foreach target,$(CFG_TARGET), \
86+
$(eval $(call INSTALL_PREPARE_N,$(target),$(CFG_BUILD))))
87+
88+
define INSTALL_TARGET_N
89+
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
90+
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
91+
install-target-$(1)-host-$(2): \
92+
$$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) \
93+
$$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
94+
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
95+
$$(Q)$$(foreach crate,$$(TARGET_CRATES),\
96+
$$(call INSTALL_LIB,$$(call CFG_LIB_GLOB_$(1),$$(crate)));\
97+
$$(call INSTALL_LIB,$$(call CFG_RLIB_GLOB,$$(crate)));)
98+
$$(Q)$$(call INSTALL_LIB,libmorestack.a)
99+
$$(Q)$$(call INSTALL_LIB,libcompiler-rt.a)
100+
101+
endef
102+
103+
define INSTALL_HOST_N
104+
105+
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
106+
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
107+
install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
108+
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
109+
$$(Q)$$(foreach crate,$$(CRATES),\
110+
$$(call INSTALL_LIB,$$(call CFG_LIB_GLOB_$(1),$$(crate)));)
111+
$$(Q)$$(foreach crate,$$(TARGET_CRATES),\
112+
$$(call INSTALL_LIB,$$(call CFG_RLIB_GLOB,$$(crate)));)
113+
$$(Q)$$(call INSTALL_LIB,libmorestack.a)
114+
$$(Q)$$(call INSTALL_LIB,libcompiler-rt.a)
115+
endef
116+
117+
$(foreach target,$(CFG_TARGET), \
118+
$(if $(findstring $(target), $(CFG_BUILD)), \
119+
$(eval $(call INSTALL_HOST_N,$(target),$(CFG_BUILD))), \
120+
$(eval $(call INSTALL_TARGET_N,$(target),$(CFG_BUILD)))))
121+
122+
INSTALL_TARGET_RULES = $(foreach target,$(CFG_TARGET), \
123+
install-target-$(target)-host-$(CFG_BUILD))
124+
125+
install: all install-host install-targets
42126

43127
# Shorthand for build/stageN/bin
44128
HB = $(HBIN$(ISTAGE)_H_$(CFG_BUILD))
@@ -50,6 +134,39 @@ PHB = $(PREFIX_BIN)
50134
# Shorthand for the prefix bin directory
51135
PHL = $(PREFIX_LIB)
52136

137+
install-host%: LIB_SOURCE_DIR=$(HL)
138+
install-host%: LIB_DESTIN_DIR=$(PHL)
139+
install-host: \
140+
install-host-prep \
141+
$(foreach tool,$(INSTALL_TOOLS),install-host-tool-$(tool))
142+
143+
install-host-prep: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD)_H_$(CFG_BUILD))
144+
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_BIN))
145+
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_LIB))
146+
$(Q)$(call MK_INSTALL_DIR,$(CFG_MANDIR)/man1)
147+
148+
define INSTALL_HOST_TOOL
149+
install-host-tool-$(1): \
150+
$$(foreach dep,$$(TOOL_DEPS_$(1)),install-host-lib-$$(dep)) \
151+
$$(CSREQ$$(ISTAGE)_T_$$(CFG_BUILD)_H_$$(CFG_BUILD))
152+
$$(Q)$$(call INSTALL,$$(HB2),$$(PHB),$(1)$$(X_$$(CFG_BUILD)))
153+
$$(Q)$$(call INSTALL,$$(S)/man,$$(CFG_MANDIR)/man1,$(1).1)
154+
endef
155+
156+
$(foreach tool,$(INSTALL_TOOLS),$(eval $(call INSTALL_HOST_TOOL,$(tool))))
157+
158+
define INSTALL_HOST_LIB
159+
install-host-lib-$(1): \
160+
$$(foreach dep,$$(RUST_DEPS_$(1)),install-host-lib-$$(dep)) \
161+
$$(CSREQ$$(ISTAGE)_T_$$(CFG_BUILD)_H_$$(CFG_BUILD))
162+
$$(Q)$$(call INSTALL_LIB,$$(call CFG_LIB_GLOB_$$(CFG_BUILD),$(1)))
163+
endef
164+
165+
$(foreach lib,$(CRATES),$(eval $(call INSTALL_HOST_LIB,$(lib))))
166+
167+
install-targets: $(INSTALL_TARGET_RULES)
168+
169+
53170
HOST_LIB_FROM_HL_GLOB = \
54171
$(patsubst $(HL)/%,$(PHL)/%,$(wildcard $(HL)/$(1)))
55172

@@ -71,10 +188,6 @@ endef
71188

72189
$(foreach lib,$(CRATES),$(eval $(call UNINSTALL_LIB,$(lib))))
73190

74-
75-
# Android runtime setup
76-
# FIXME: This probably belongs somewhere else
77-
78191
# target platform specific variables
79192
# for arm-linux-androidabi
80193
define DEF_ADB_DEVICE_STATUS

0 commit comments

Comments
 (0)