Skip to content

Commit 9257338

Browse files
nikomatsakisbrson
authored andcommitted
---
yaml --- r: 6119 b: refs/heads/master c: 2bfa72e h: refs/heads/master i: 6117: f968c42 6115: 1837e19 6111: 37cf4a2 v: v3
1 parent 211842e commit 9257338

File tree

4 files changed

+33
-20
lines changed

4 files changed

+33
-20
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 54af489e6f14fd1382c7b84c9cf85fecf91ba276
2+
refs/heads/master: 2bfa72ea42493c3337737cd35c5cd366502031c3

trunk/configure

+7-1
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,19 @@ step_msg "making directories"
394394
for i in \
395395
doc doc/std \
396396
nd nd/std \
397-
rustllvm dl \
397+
dl \
398398
test/run-pass test/run-fail test/compile-fail \
399399
test/bench test/perf test/pretty
400400
do
401401
make_dir $i
402402
done
403403

404+
make_dir rustllvm
405+
for t in $CFG_TARGET_TRIPLES
406+
do
407+
make_dir rustllvm/$t
408+
done
409+
404410
make_dir rt
405411
for t in $CFG_TARGET_TRIPLES
406412
do

trunk/mk/rustllvm.mk

+23-16
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@
22
# rustc LLVM-extensions (C++) library variables and rules
33
######################################################################
44

5-
RUSTLLVM_OBJS_CS := $(addprefix rustllvm/, RustGCMetadataPrinter.cpp \
5+
define DEF_RUSTLLVM_TARGETS
6+
7+
RUSTLLVM_OBJS_CS_$(1) := $$(addprefix rustllvm/, RustGCMetadataPrinter.cpp \
68
RustGCStrategy.cpp RustWrapper.cpp)
79

810
# Behind an ifdef for now since this requires a patched LLVM.
911
ifdef CFG_STACK_GROWTH
10-
RUSTLLVM_OBJS_CS += rustllvm/RustPrologHook.cpp
12+
RUSTLLVM_OBJS_CS_$(1) += rustllvm/RustPrologHook.cpp
1113
endif
1214

13-
RUSTLLVM_DEF := rustllvm/rustllvm$(CFG_DEF_SUFFIX)
15+
RUSTLLVM_DEF_$(1) := rustllvm/rustllvm$$(CFG_DEF_SUFFIX)
16+
17+
RUSTLLVM_INCS_$(1) := -iquote $$(CFG_LLVM_INCDIR) \
18+
-iquote $$(S)src/rustllvm/include
19+
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)/%.o)
1420

15-
RUSTLLVM_INCS := -iquote $(CFG_LLVM_INCDIR) \
16-
-iquote $(S)src/rustllvm/include
17-
RUSTLLVM_OBJS_OBJS := $(RUSTLLVM_OBJS_CS:.cpp=.o)
21+
rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
22+
$$(MKFILES) $$(RUSTLLVM_DEF_$(1))
23+
@$$(call E, link: $$@)
24+
$$(Q)$$(call CFG_LINK_C_$(1),$$@,$$(RUSTLLVM_OBJS_OBJS_$(1)) \
25+
$$(CFG_GCCISH_PRE_LIB_FLAGS) $$(CFG_LLVM_LIBS) \
26+
$$(CFG_GCCISH_POST_LIB_FLAGS) \
27+
$$(CFG_LLVM_LDFLAGS),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM))
1828

19-
rustllvm/$(CFG_RUSTLLVM): $(RUSTLLVM_OBJS_OBJS) \
20-
$(MKFILES) $(RUSTLLVM_DEF)
21-
@$(call E, link: $@)
22-
$(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_OBJS_OBJS) \
23-
$(CFG_GCCISH_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \
24-
$(CFG_GCCISH_POST_LIB_FLAGS) \
25-
$(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF),$(CFG_RUSTLLVM))
29+
rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILES)
30+
@$$(call E, compile: $$@)
31+
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(CFG_LLVM_CXXFLAGS) $$(RUSTLLVM_INCS_$(1))) $$<
2632

27-
rustllvm/%.o: rustllvm/%.cpp $(MKFILES)
28-
@$(call E, compile: $@)
29-
$(Q)$(call CFG_COMPILE_C, $@, $(CFG_LLVM_CXXFLAGS) $(RUSTLLVM_INCS)) $<
33+
endef
3034

35+
# Instantiate template for all stages
36+
$(foreach target,$(CFG_TARGET_TRIPLES), \
37+
$(eval $(call DEF_RUSTLLVM_TARGETS,$(target))))

trunk/mk/target.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ $$(TARGET_LIB$(1)$(2))/libstd.rlib: \
3535
@$$(call E, compile_and_link: $$@)
3636
$$(STAGE$(1)_$(2)) --lib --static -o $$@ $$<
3737

38-
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUNTIME): rt/$(2)/$(CFG_RUNTIME)
38+
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUNTIME): rt/$(2)/$$(CFG_RUNTIME)
3939
@$$(call E, cp: $$@)
4040
$$(Q)cp $$< $$@
4141

42-
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUSTLLVM): rustllvm/$$(CFG_RUSTLLVM)
42+
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUSTLLVM): rustllvm/$(2)/$$(CFG_RUSTLLVM)
4343
@$$(call E, cp: $$@)
4444
$$(Q)cp $$< $$@
4545

0 commit comments

Comments
 (0)