2011-10-02 05:12:08 +02:00
|
|
|
# TARGET_STAGE_N template: This defines how target artifacts are built
|
|
|
|
# for all stage/target architecture combinations. Argument 1 is the
|
|
|
|
# stage and arg 2 is the target triple
|
|
|
|
|
|
|
|
# FIXME: We don't actually know how to build many of these when host
|
|
|
|
# and target architectures are not the same
|
|
|
|
|
|
|
|
define TARGET_STAGE_N
|
|
|
|
|
2011-10-14 20:31:40 +02:00
|
|
|
$$(TARGET_LIB$(1)$(2))/intrinsics.ll: \
|
2011-11-02 00:50:47 +01:00
|
|
|
$$(S)src/rt/intrinsics/intrinsics.$(HOST_$(2)).ll.in
|
2011-10-14 20:31:40 +02:00
|
|
|
@$$(call E, sed: $$@)
|
2011-10-14 21:22:20 +02:00
|
|
|
$$(Q)sed s/@CFG_TARGET_TRIPLE@/$(2)/ $$< > $$@
|
2011-10-14 20:31:40 +02:00
|
|
|
|
2011-11-02 23:10:19 +01:00
|
|
|
$$(TARGET_LIB$(1)$(2))/intrinsics.bc: $$(TARGET_LIB$(1)$(2))/intrinsics.ll \
|
2011-11-03 00:21:17 +01:00
|
|
|
$$(LLVM_CONFIG_$(2))
|
2011-10-14 20:31:40 +02:00
|
|
|
@$$(call E, llvms-as: $$@)
|
2011-11-03 00:21:17 +01:00
|
|
|
$$(Q)$$(LLVM_AS_$(2)) -o $$@ $$<
|
2011-10-02 05:12:08 +02:00
|
|
|
|
2011-11-29 02:23:13 +01:00
|
|
|
$$(TARGET_LIB$(1)$(2))/libmorestack.a: rt/$(2)/arch/$$(HOST_$(2))/libmorestack.a
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-10-02 05:12:08 +02:00
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_STDLIB): \
|
|
|
|
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
|
|
|
|
$$(TARGET_SREQ$(1)$(2))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-10-14 21:22:20 +02:00
|
|
|
$$(STAGE$(1)_$(2)) --lib -o $$@ $$<
|
2011-10-02 05:12:08 +02:00
|
|
|
|
|
|
|
$$(TARGET_LIB$(1)$(2))/libstd.rlib: \
|
|
|
|
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
|
|
|
|
$$(TARGET_SREQ$(1)$(2))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-10-14 21:22:20 +02:00
|
|
|
$$(STAGE$(1)_$(2)) --lib --static -o $$@ $$<
|
2011-10-02 05:12:08 +02:00
|
|
|
|
2011-11-02 01:28:41 +01:00
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUNTIME): rt/$(2)/$$(CFG_RUNTIME)
|
2011-10-02 05:12:08 +02:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-02 01:28:41 +01:00
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUSTLLVM): rustllvm/$(2)/$$(CFG_RUSTLLVM)
|
2011-10-02 05:12:08 +02:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
|
|
|
$$(TARGET_BIN$(1)$(2))/rustc$$(X): \
|
|
|
|
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
|
|
|
$$(TARGET_SREQ$(1)$(2)) \
|
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUSTLLVM) \
|
|
|
|
$$(TARGET_STDLIB_DEFAULT$(1)$(2))
|
2011-10-14 23:08:04 +02:00
|
|
|
@$$(call E, compile_and_link: $$@ for stage $(1) and target $(2))
|
2011-10-14 21:22:20 +02:00
|
|
|
$$(STAGE$(1)_$(2)) -o $$@ $$<
|
2011-10-02 05:12:08 +02:00
|
|
|
|
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_LIBRUSTC): \
|
|
|
|
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
|
|
|
$$(TARGET_SREQ$(1)$(2)) \
|
|
|
|
$$(TARGET_LIB$(1)$(2))/$$(CFG_RUSTLLVM) \
|
|
|
|
$$(TARGET_STDLIB_DEFAULT$(1)$(2))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-10-14 21:22:20 +02:00
|
|
|
$$(STAGE$(1)_$(2)) --lib -o $$@ $$<
|
2011-10-02 05:12:08 +02:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Instantiate template for all stages
|
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call TARGET_STAGE_N,0,$(target))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,1,$(target))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,2,$(target))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,3,$(target))))
|