makefiles now seem to be working, rustc is not

This commit is contained in:
Niko Matsakis 2011-11-22 13:04:52 -08:00
parent 791dc23c83
commit 8371beb590
3 changed files with 42 additions and 7 deletions

View File

@ -59,11 +59,14 @@ GEN_MKFILES := $(wildcard $(CFG_SRC_DIR)/mk/libuv/*/*/*) \
MKFILES := $(OUR_MKFILES) $(3RDPARTY_MKFILES) $(GEN_MKFILES)
NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
ifneq ($(MAKE_RESTARTS),)
CFG_INFO := $(info cfg: make restarts: $(MAKE_RESTARTS))
endif
CFG_INFO := $(info cfg: shell host triple $(CFG_HOST_TRIPLE))
CFG_INFO := $(info cfg: non host triples $(NON_HOST_TRIPLES))
ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
@ -220,7 +223,6 @@ endef
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call DEF_LLVM_VARS,$(target))))
######################################################################
# Exports for sub-utilities
######################################################################

View File

@ -20,3 +20,35 @@ $(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_STDLIB): \
$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUSTLLVM): \
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
$(Q)touch $@
# 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
$$(HBIN0_H_$(1))/rustc$$(X): \
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(HLIB0_H_$(1))/$$(CFG_RUNTIME): \
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(HLIB0_H_$(1))/$(CFG_STDLIB): \
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
endef
$(foreach t,$(NON_HOST_TRIPLES), \
$(eval $(call BOOTSTRAP_STAGE0,$(t),2,$(CFG_HOST_TRIPLE))))

View File

@ -56,9 +56,10 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
endef
# Instantiate template for all stages
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call TARGET_STAGE_N,0,$(target),$(CFG_HOST_TRIPLE))) \
$(eval $(call TARGET_STAGE_N,1,$(target),$(CFG_HOST_TRIPLE))) \
$(eval $(call TARGET_STAGE_N,2,$(target),$(CFG_HOST_TRIPLE))) \
$(eval $(call TARGET_STAGE_N,3,$(target),$(CFG_HOST_TRIPLE))))
# In principle, each host can build each target:
$(foreach source,$(CFG_TARGET_TRIPLES), \
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call TARGET_STAGE_N,0,$(source),$(target))) \
$(eval $(call TARGET_STAGE_N,1,$(source),$(target))) \
$(eval $(call TARGET_STAGE_N,2,$(source),$(target))) \
$(eval $(call TARGET_STAGE_N,3,$(source),$(target)))))