2012-12-10 19:32:48 -06:00
|
|
|
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2011-10-01 22:12:08 -05:00
|
|
|
# TARGET_STAGE_N template: This defines how target artifacts are built
|
2011-11-21 15:11:40 -06:00
|
|
|
# for all stage/target architecture combinations. The arguments:
|
|
|
|
# $(1) is the stage
|
|
|
|
# $(2) is the target triple
|
|
|
|
# $(3) is the host triple
|
2011-10-01 22:12:08 -05:00
|
|
|
|
2012-01-09 16:08:08 -06:00
|
|
|
|
2011-10-01 22:12:08 -05:00
|
|
|
define TARGET_STAGE_N
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
|
|
|
|
rt/$(2)/arch/$$(HOST_$(2))/libmorestack.a
|
2011-11-28 19:23:13 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM): \
|
|
|
|
rustllvm/$(2)/$$(CFG_RUSTLLVM)
|
2011-10-01 22:12:08 -05:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
|
|
|
|
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
|
2012-05-29 23:35:12 -05:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX)
|
2012-03-22 17:27:35 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
2012-11-06 21:44:58 -06:00
|
|
|
$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
|
|
|
|
$$(DRIVER_CRATE) \
|
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
|
|
|
|
ifdef CFG_ENABLE_PAX_FLAGS
|
|
|
|
@$$(call E, apply PaX flags: $$@)
|
|
|
|
@"$(CFG_PAXCTL)" -cm "$$@"
|
|
|
|
endif
|
|
|
|
|
2012-05-29 23:35:12 -05:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX): \
|
|
|
|
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
|
2011-12-20 04:17:13 -06:00
|
|
|
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM) \
|
2011-12-16 19:21:18 -06:00
|
|
|
$$(TCORELIB_DEFAULT$(1)_T_$(2)_H_$(3)) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TSTDLIB_DEFAULT$(1)_T_$(2)_H_$(3))
|
2011-10-01 22:12:08 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-04-26 18:02:01 -05:00
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) $(BORROWCK) -o $$@ $$< && touch $$@
|
2011-10-01 22:12:08 -05:00
|
|
|
|
2012-01-06 14:06:35 -06:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUNTIME): \
|
|
|
|
rt/$(2)/$$(CFG_RUNTIME)
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-03-16 09:14:33 -05:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB): \
|
|
|
|
$$(CORELIB_CRATE) $$(CORELIB_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(2)_H_$(3))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-03-22 10:39:41 -05:00
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
|
2012-03-16 09:14:33 -05:00
|
|
|
|
2012-05-22 13:40:46 -05:00
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB): \
|
|
|
|
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
|
|
|
|
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TSREQ$(1)_T_$(2)_H_$(3))
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2011-11-22 15:04:52 -06:00
|
|
|
# In principle, each host can build each target:
|
2012-03-16 09:14:33 -05:00
|
|
|
$(foreach source,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
2012-01-06 14:06:35 -06:00
|
|
|
$(eval $(call TARGET_STAGE_N,0,$(target),$(source))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,1,$(target),$(source))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,2,$(target),$(source))) \
|
|
|
|
$(eval $(call TARGET_STAGE_N,3,$(target),$(source)))))
|