Skip to content

Commit

Permalink
makefiles now seem to be working, rustc is not
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Nov 29, 2011
1 parent 791dc23 commit 8371beb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -220,7 +223,6 @@ endef
$(foreach target,$(CFG_TARGET_TRIPLES), \
$(eval $(call DEF_LLVM_VARS,$(target))))


######################################################################
# Exports for sub-utilities
######################################################################
Expand Down
32 changes: 32 additions & 0 deletions mk/stage0.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
13 changes: 7 additions & 6 deletions mk/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)))))

0 comments on commit 8371beb

Please sign in to comment.