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.
|
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
# Generic rule for copying any target crate to a host crate. This rule will also
|
|
|
|
# promote any dependent rust crates up to their host locations as well
|
2011-10-01 22:12:08 -05:00
|
|
|
#
|
2014-01-24 21:27:22 -06:00
|
|
|
# $(1) - the stage to copy from
|
|
|
|
# $(2) - the stage to copy to
|
|
|
|
# $(3) - the host triple
|
|
|
|
# $(4) - the target triple (same as $(3))
|
|
|
|
# $(5) - the name of the crate being processed
|
|
|
|
define CP_HOST_STAGE_N_CRATE
|
|
|
|
|
|
|
|
$$(HLIB$(2)_H_$(4))/stamp.$(5): \
|
|
|
|
$$(TLIB$(1)_T_$(3)_H_$(4))/stamp.$(5) \
|
|
|
|
$$(RUST_DEPS_$(5):%=$$(HLIB$(2)_H_$(4))/stamp.%) \
|
2013-05-04 05:46:11 -05:00
|
|
|
| $$(HLIB$(2)_H_$(4))/
|
2014-01-24 21:27:22 -06:00
|
|
|
@$$(call E, cp: $$(@D)/lib$(5))
|
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES,\
|
|
|
|
$$(dir $$@)$$(call CFG_LIB_GLOB_$(3),$(5)))
|
2011-10-01 22:12:08 -05:00
|
|
|
$$(Q)cp $$< $$@
|
2014-01-24 21:27:22 -06:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(3)_H_$(4))/$$(call CFG_LIB_GLOB_$(3),$(5)) \
|
2011-12-02 10:51:59 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
2014-01-24 21:27:22 -06:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES,\
|
|
|
|
$$(dir $$@)$$(call CFG_LIB_GLOB_$(3),$(5)))
|
2011-10-01 22:12:08 -05:00
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
endef
|
2012-03-22 17:27:35 -05:00
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
# Same as the above macro, but for tools instead of crates
|
|
|
|
define CP_HOST_STAGE_N_TOOL
|
2011-10-01 22:12:08 -05:00
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/$(5)$$(X_$(3)): \
|
|
|
|
$$(TBIN$(1)_T_$(3)_H_$(4))/$(5)$$(X_$(3)) \
|
|
|
|
$$(TOOL_DEPS_$(5):%=$$(HLIB$(2)_H_$(4))/stamp.%) \
|
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2011-12-05 18:46:37 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
endef
|
2011-12-16 19:21:18 -06:00
|
|
|
|
2013-12-12 20:07:23 -06:00
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
# Miscellaneous rules for just making a few directories.
|
|
|
|
#
|
|
|
|
# $(1) - the stage to copy from
|
|
|
|
# $(2) - the stage to copy to
|
|
|
|
# $(3) - the target triple
|
|
|
|
# $(4) - the host triple (same as $(3))
|
|
|
|
define CP_HOST_STAGE_N
|
2013-12-12 20:07:23 -06:00
|
|
|
|
2013-05-03 11:53:47 -05:00
|
|
|
$$(HBIN$(2)_H_$(4))/:
|
2014-01-24 21:27:22 -06:00
|
|
|
@mkdir -p $$@
|
2013-05-03 11:53:47 -05:00
|
|
|
|
2014-01-13 18:45:33 -06:00
|
|
|
ifneq ($(CFG_LIBDIR_RELATIVE),bin)
|
2013-05-04 05:46:11 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/:
|
2014-01-24 21:27:22 -06:00
|
|
|
@mkdir -p $$@
|
2013-05-07 01:29:05 -05:00
|
|
|
endif
|
2013-05-04 05:46:11 -05:00
|
|
|
|
2011-10-01 22:12:08 -05:00
|
|
|
endef
|
|
|
|
|
2014-01-24 21:27:22 -06:00
|
|
|
$(foreach t,$(CFG_HOST), \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N,0,1,$(t),$(t))) \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N,1,2,$(t),$(t))) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$(eval $(call CP_HOST_STAGE_N,2,3,$(t),$(t))))
|
2014-01-24 21:27:22 -06:00
|
|
|
|
|
|
|
$(foreach crate,$(CRATES), \
|
|
|
|
$(foreach t,$(CFG_HOST), \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_CRATE,0,1,$(t),$(t),$(crate))) \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_CRATE,1,2,$(t),$(t),$(crate))) \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_CRATE,2,3,$(t),$(t),$(crate)))))
|
|
|
|
|
|
|
|
$(foreach tool,$(TOOLS), \
|
|
|
|
$(foreach t,$(CFG_HOST), \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_TOOL,0,1,$(t),$(t),$(tool))) \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_TOOL,1,2,$(t),$(t),$(tool))) \
|
|
|
|
$(eval $(call CP_HOST_STAGE_N_TOOL,2,3,$(t),$(t),$(tool)))))
|