2011-10-01 22:12:08 -05:00
|
|
|
# Extract the snapshot host compiler
|
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HBIN0_H_$(CFG_BUILD))/:
|
2013-07-04 09:51:45 -05:00
|
|
|
mkdir -p $@
|
2012-04-05 17:40:34 -05:00
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/:
|
2013-07-04 09:51:45 -05:00
|
|
|
mkdir -p $@
|
2012-04-05 17:40:34 -05:00
|
|
|
|
2013-08-31 17:53:56 -05:00
|
|
|
$(SNAPSHOT_RUSTC_POST_CLEANUP): \
|
2011-11-21 15:11:40 -06:00
|
|
|
$(S)src/snapshots.txt \
|
2013-07-04 09:51:45 -05:00
|
|
|
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS) \
|
2013-10-21 04:18:21 -05:00
|
|
|
| $(HBIN0_H_$(CFG_BUILD))/
|
2013-07-04 09:51:45 -05:00
|
|
|
|
2011-05-03 13:34:44 -05:00
|
|
|
@$(call E, fetch: $@)
|
2012-02-09 19:58:09 -06:00
|
|
|
# Note: the variable "SNAPSHOT_FILE" is generally not set, and so
|
2013-05-03 18:25:04 -05:00
|
|
|
# we generally only pass one argument to this script.
|
2012-04-05 17:40:34 -05:00
|
|
|
ifdef CFG_ENABLE_LOCAL_RUST
|
2013-10-21 04:18:21 -05:00
|
|
|
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT)
|
2013-05-03 18:25:04 -05:00
|
|
|
else
|
2013-10-21 04:18:21 -05:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
|
2012-10-04 17:08:34 -05:00
|
|
|
ifdef CFG_ENABLE_PAX_FLAGS
|
|
|
|
@$(call E, apply PaX flags: $@)
|
2012-10-03 20:46:32 -05:00
|
|
|
@"$(CFG_PAXCTL)" -cm "$@"
|
|
|
|
endif
|
2013-05-03 18:25:04 -05:00
|
|
|
endif
|
2011-05-03 17:51:21 -05:00
|
|
|
$(Q)touch $@
|
2011-05-01 15:18:52 -05:00
|
|
|
|
2011-10-01 22:12:08 -05:00
|
|
|
# Host libs will be extracted by the above rule
|
2011-05-03 13:34:44 -05:00
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_RUNTIME_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2011-07-21 18:11:35 -05:00
|
|
|
$(Q)touch $@
|
2011-05-04 20:28:30 -05:00
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_STDLIB_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2011-12-05 18:46:37 -06:00
|
|
|
$(Q)touch $@
|
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_EXTRALIB_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2011-07-20 18:32:53 -05:00
|
|
|
$(Q)touch $@
|
2011-07-11 15:31:47 -05:00
|
|
|
|
2013-11-01 02:09:04 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_LIBRUSTUV_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2013-10-22 17:13:18 -05:00
|
|
|
$(Q)touch $@
|
|
|
|
|
2013-11-01 02:09:04 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_LIBRUSTC_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2011-12-16 19:21:18 -06:00
|
|
|
$(Q)touch $@
|
|
|
|
|
2013-10-21 04:18:21 -05:00
|
|
|
$(HLIB0_H_$(CFG_BUILD))/$(CFG_RUSTLLVM_$(CFG_BUILD)): \
|
|
|
|
$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD)) \
|
|
|
|
| $(HLIB0_H_$(CFG_BUILD))/
|
2011-07-11 15:31:47 -05:00
|
|
|
$(Q)touch $@
|
2011-11-22 15:04:52 -06:00
|
|
|
|
|
|
|
# For other targets, let the host build the target:
|
|
|
|
|
|
|
|
define BOOTSTRAP_STAGE0
|
|
|
|
# $(1) target to bootstrap
|
|
|
|
# $(2) stage to bootstrap from
|
|
|
|
# $(3) target to bootstrap from
|
|
|
|
|
2013-07-04 09:51:45 -05:00
|
|
|
$(HBIN0_H_$(1))/:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(HLIB0_H_$(1))/:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$$(HBIN0_H_$(1))/rustc$$(X_$(1)): \
|
|
|
|
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X_$(1)) \
|
|
|
|
| $(HBIN0_H_$(1))/
|
2011-11-22 15:04:52 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_RUNTIME_$(1)): \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_RUNTIME_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
2011-11-22 15:04:52 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_STDLIB_$(1)): \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_STDLIB_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
2011-11-22 15:04:52 -06:00
|
|
|
@$$(call E, cp: $$@)
|
2013-10-22 17:13:18 -05:00
|
|
|
$$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(STDLIB_GLOB_$(1)) $$@
|
2013-10-22 17:13:18 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(STDLIB_GLOB_$(4)),$$(notdir $$@))
|
2011-11-22 15:04:52 -06:00
|
|
|
|
2013-05-17 12:45:09 -05:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_EXTRALIB_$(1)): \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_EXTRALIB_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
2013-05-17 12:45:09 -05:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(4)),$$(notdir $$@))
|
2013-05-17 12:45:09 -05:00
|
|
|
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(EXTRALIB_GLOB_$(1)) $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(EXTRALIB_GLOB_$(4)),$$(notdir $$@))
|
2013-05-17 12:45:09 -05:00
|
|
|
|
2013-10-29 16:14:34 -05:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTUV_$(1)): \
|
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTUV_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
|
|
|
|
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(LIBRUSTUV_GLOB_$(1)) $$@
|
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTUV_GLOB_$(4)),$$(notdir $$@))
|
2013-10-22 17:13:18 -05:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_LIBRUSTC_$(1)): \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTC_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
2011-12-16 19:21:18 -06:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(LIBRUSTC_GLOB_$(1)) $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTC_GLOB_$(4)),$$(notdir $$@))
|
2011-12-16 19:21:18 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM_$(1)): \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_RUSTLLVM_$(1)) \
|
|
|
|
| $(HLIB0_H_$(1))/
|
2011-11-22 15:04:52 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
# Use stage1 to build other architectures: then you don't have to wait
|
|
|
|
# for stage2, but you get the latest updates to the compiler source.
|
2013-11-01 02:09:04 -05:00
|
|
|
$(foreach t,$(NON_BUILD_HOST), \
|
2013-10-21 04:18:21 -05:00
|
|
|
$(eval $(call BOOTSTRAP_STAGE0,$(t),1,$(CFG_BUILD))))
|