Fix error where make check would not produce compilers first, due to make's infinite-recursion-prevention heuristic.

This commit is contained in:
Graydon Hoare 2011-03-31 14:58:17 -07:00
parent 3c1de96cda
commit 6d857c0c84
1 changed files with 32 additions and 0 deletions

View File

@ -505,6 +505,38 @@ stage2/glue.bc: stage2/rustc$(X) stage1/$(CFG_STDLIB) \
@$(call E, generate: $@)
$(STAGE2) -o $@ -glue
# Due to make not wanting to run the same implicit rules twice on the same
# rule tree (implicit-rule recursion prevention, see "Chains of Implicit
# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here
# for different directories, to handle cases where (say) a test relies on a
# compiler that relies on a .o file.
stage0/%.o: stage0/%.s
@$(call E, assemble [llvm]: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) -o $@ -c $<
stage0/%.s: stage0/%.bc
@$(call E, compile [llvm]: $@)
$(Q)$(CFG_LLVM_BINDIR)/llc $(CFG_LLC_CFLAGS) -o $@ $<
stage1/%.o: stage1/%.s
@$(call E, assemble [llvm]: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) -o $@ -c $<
stage1/%.s: stage1/%.bc
@$(call E, compile [llvm]: $@)
$(Q)$(CFG_LLVM_BINDIR)/llc $(CFG_LLC_CFLAGS) -o $@ $<
stage2/%.o: stage2/%.s
@$(call E, assemble [llvm]: $@)
$(Q)gcc $(CFG_GCC_CFLAGS) -o $@ -c $<
stage2/%.s: stage2/%.bc
@$(call E, compile [llvm]: $@)
$(Q)$(CFG_LLVM_BINDIR)/llc $(CFG_LLC_CFLAGS) -o $@ $<
######################################################################
# Library and boot rules
######################################################################