Skip to content

Commit 6f5ca53

Browse files
committed
---
yaml --- r: 5650 b: refs/heads/master c: 9563c17 h: refs/heads/master v: v3
1 parent aa3dcdf commit 6f5ca53

File tree

4 files changed

+70
-7
lines changed

4 files changed

+70
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 42287d0fd36ce914e59174aa56f3dfafda4bc01b
2+
refs/heads/master: 9563c17d78570dc5646786c142a0f0b68a86dd3e

trunk/Makefile.in

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,16 @@ LLC := $(CFG_LLVM_BINDIR)/llc$(X)
163163

164164
define SREQ
165165

166-
# Destinations of artifacts for target architectures
167-
TARGET_ROOT$(1)$(2) = stage$(1)/lib/rustc/$(2)
168-
TARGET_BIN$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/bin
169-
TARGET_LIB$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/lib
170-
171166
# Destinations of artifacts for the host compiler
172167
HOST_ROOT$(1) = stage$(1)
173168
HOST_BIN$(1) = $$(HOST_ROOT$(1))/bin
174169
HOST_LIB$(1) = $$(HOST_ROOT$(1))/lib
175170

171+
# Destinations of artifacts for target architectures
172+
TARGET_ROOT$(1)$(2) = $$(HOST_LIB$(1))/rustc/$(2)
173+
TARGET_BIN$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/bin
174+
TARGET_LIB$(1)$(2) = $$(TARGET_ROOT$(1)$(2))/lib
175+
176176
# The target locations of artifacts for the host architecture (used for
177177
# promoting target binaries to host binaries)
178178
TARGET_HOST_ROOT$(1) = $$(TARGET_ROOT$(1)$$(CFG_HOST_TRIPLE))
@@ -318,3 +318,8 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),)
318318
CFG_INFO := $(info cfg: including clean rules)
319319
include $(CFG_SRC_DIR)/mk/clean.mk
320320
endif
321+
322+
ifneq ($(findstring install,$(MAKECMDGOALS)),)
323+
CFG_INFO := $(info cfg: including install rules)
324+
include $(CFG_SRC_DIR)/mk/install.mk
325+
endif

trunk/configure

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ else
339339
CFG_C_COMPILER="gcc"
340340
fi
341341

342+
if [ -z "$CFG_PREFIX" ]
343+
then
344+
CFG_PREFIX=/usr/local
345+
fi
346+
342347
if [ ! -z "$CFG_LLVM_TRIPLE" ]
343348
then
344349
if [ $CFG_HOST_TRIPLE != $CFG_LLVM_TRIPLE ]
@@ -357,8 +362,8 @@ CFG_TARGET_TRIPLES="${CFG_HOST_TRIPLE}"
357362
putvar CFG_HOST_TRIPLE
358363
putvar CFG_TARGET_TRIPLES
359364

360-
361365
putvar CFG_C_COMPILER
366+
putvar CFG_PREFIX
362367

363368
putvar CFG_LLVM_ROOT
364369
putvar CFG_LLVM_INCDIR

trunk/mk/install.mk

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
ifdef VERBOSE
2+
INSTALL = cp $(1)/$(3) $(2)/$(3)
3+
else
4+
INSTALL = @$(call E, install $(2)/$(3)) && cp $(1)/$(3) $(2)/$(3)
5+
endif
6+
7+
ISTAGE = 1
8+
9+
PREFIX_ROOT = $(CFG_PREFIX)
10+
PREFIX_BIN = $(PREFIX_ROOT)/bin
11+
PREFIX_LIB = $(PREFIX_ROOT)/lib
12+
13+
HB = $(HOST_BIN$(ISTAGE))
14+
HL = $(HOST_LIB$(ISTAGE))
15+
PHB = $(PREFIX_BIN)
16+
PHL = $(PREFIX_LIB)
17+
18+
define INSTALL_TARGET_N
19+
20+
PREFIX_TARGET_ROOT$(1) = $$(PREFIX_LIB)/rustc/$(1)
21+
PREFIX_TARGET_BIN$(1) = $$(PREFIX_TARGET_ROOT$(1))/bin
22+
PREFIX_TARGET_LIB$(1) = $$(PREFIX_TARGET_ROOT$(1))/lib
23+
24+
TB$(1) = $$(TARGET_BIN$$(ISTAGE)$(1))
25+
TL$(1) = $$(TARGET_LIB$$(ISTAGE)$(1))
26+
PTB$(1) = $$(PREFIX_TARGET_BIN$(1))
27+
PTL$(1) = $$(PREFIX_TARGET_LIB$(1))
28+
29+
install-target$(1): $$(SREQ$$(ISTAGE)$(1))
30+
$(Q)mkdir -p $$(PREFIX_TARGET_LIB$(1))
31+
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),$$(CFG_RUNTIME))
32+
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),$$(CFG_STDLIB))
33+
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),intrinsics.bc)
34+
$(Q)$(call INSTALL,$$(TL$(1)),$$(PTL$(1)),main.o)
35+
endef
36+
37+
$(foreach target,$(CFG_TARGET_TRIPLES), \
38+
$(eval $(call INSTALL_TARGET_N,$(target))))
39+
40+
INSTALL_TARGET_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \
41+
install-target$(target))
42+
43+
install: install-host install-targets
44+
45+
install-host: $(SREQ$(ISTAGE)$(CFG_HOST_TRIPLE))
46+
$(Q)mkdir -p $(PREFIX_BIN)
47+
$(Q)mkdir -p $(PREFIX_LIB)
48+
$(Q)$(call INSTALL,$(HB),$(PHB),rustc$(X))
49+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME))
50+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_STDLIB))
51+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM))
52+
53+
install-targets: $(INSTALL_TARGET_RULES)

0 commit comments

Comments
 (0)