build: Add USE_SNAPSHOT_STDLIB. Set to 1

This commit is contained in:
Brian Anderson 2012-05-22 11:40:46 -07:00
parent 1523298bc7
commit a4ba088ef8
1 changed files with 36 additions and 7 deletions

View File

@ -10,6 +10,7 @@
# (resp. corelib) from the working directory.
USE_SNAPSHOT_RUNTIME=1
USE_SNAPSHOT_CORELIB=1
USE_SNAPSHOT_STDLIB=1
define TARGET_STAGE_N
@ -18,13 +19,6 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(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 $$@
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM): \
rustllvm/$(2)/$$(CFG_RUSTLLVM)
@$$(call E, cp: $$@)
@ -116,6 +110,30 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_CORELIB): \
endef
define TARGET_STDLIB_FROM_SNAPSHOT
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB): \
$$(HLIB$(1)_H_$(3))/$$(CFG_STDLIB) \
$$(STDLIB_INPUTS) \
$$(TSREQ$(1)_T_$(2)_H_$(3))
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(Q)cp $$(HLIB$(1)_H_$(3))/$$(STDLIB_GLOB) \
$$(TLIB$(1)_T_$(2)_H_$(3))
endef
define TARGET_STDLIB_FROM_WD
$$(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
# In principle, each host can build each target:
$(foreach source,$(CFG_TARGET_TRIPLES), \
$(foreach target,$(CFG_TARGET_TRIPLES), \
@ -142,6 +160,14 @@ else
$(eval $(call TARGET_CORELIB_FROM_WD,0,$(src),$(src))))
endif
ifeq ($(USE_SNAPSHOT_STDLIB),1)
$(foreach src,$(CFG_HOST_TRIPLE),\
$(eval $(call TARGET_STDLIB_FROM_SNAPSHOT,0,$(src),$(src))))
else
$(foreach src,$(CFG_HOST_TRIPLE),\
$(eval $(call TARGET_STDLIB_FROM_WD,0,$(src),$(src))))
endif
# Non-host triples build the stage0 runtime from the working directory
$(foreach source,$(CFG_TARGET_TRIPLES), \
$(foreach target,$(NON_HOST_TRIPLES), \
@ -158,5 +184,8 @@ $(foreach source,$(CFG_TARGET_TRIPLES), \
$(eval $(call TARGET_CORELIB_FROM_WD,1,$(target),$(source))) \
$(eval $(call TARGET_CORELIB_FROM_WD,2,$(target),$(source))) \
$(eval $(call TARGET_CORELIB_FROM_WD,3,$(target),$(source))) \
$(eval $(call TARGET_STDLIB_FROM_WD,1,$(target),$(source))) \
$(eval $(call TARGET_STDLIB_FROM_WD,2,$(target),$(source))) \
$(eval $(call TARGET_STDLIB_FROM_WD,3,$(target),$(source))) \
))