Tweak makefiles, change the way the fuzzer is built

Since librustc and the fuzzer depend on rustllvm, build them
like rustc, linking to libraries in lib instead of lib/rustc/$(target)
This commit is contained in:
Brian Anderson 2011-09-29 21:34:46 -07:00
parent 9385ad4952
commit 9f9666af6e
3 changed files with 25 additions and 14 deletions

View File

@ -226,7 +226,8 @@ CFG_INFO := $(info cfg: *** compiler is in snapshot transition ***)
CFG_INFO := $(info cfg: *** stage2 and later will not be built ***)
CFG_INFO := $(info cfg:)
all: $(SREQ0$(CFG_HOST_TRIPLE)) $(SREQ1$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) $(FUZZ)
all: $(SREQ0$(CFG_HOST_TRIPLE)) $(SREQ1$(CFG_HOST_TRIPLE)) \
$(GENERATED) $(DOCS) $(FUZZ)
else
ALL_SREQS = $(foreach target,$(CFG_TARGET_TRIPLES), \

View File

@ -1,9 +1,19 @@
# At the moment the fuzzer only exists in stage1.
FUZZER_CRATE := $(S)src/fuzzer/fuzzer.rc
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
stage1/bin/fuzzer$(X): $(FUZZER_CRATE) $(FUZZER_INPUTS) $(SREQ1) \
stage1/lib/rustc/$(CFG_HOST_TRIPLE)/$(CFG_LIBRUSTC)
@$(call E, compile_and_link: $@)
$(STAGE1) -o $@ $<
define FUZZ_STAGE_N
stage$(2)/bin/fuzzer$$(X): $$(FUZZER_CRATE) $$(FUZZER_INPUTS) \
$$(SREQ$(2)$(CFG_HOST_TRIPLE)) \
stage$(2)/lib/$$(CFG_RUNTIME) \
stage$(2)/lib/$$(CFG_RUSTLLVM) \
stage$(2)/lib/$$(CFG_STDLIB) \
stage$(2)/lib/$$(CFG_LIBRUSTC)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)) -L stage1/lib -o $$@ $$<
endef
$(eval $(call FUZZ_STAGE_N,0,1))
$(eval $(call FUZZ_STAGE_N,1,2))
$(eval $(call FUZZ_STAGE_N,2,3))

View File

@ -36,7 +36,13 @@ stage$(2)/bin/rustc$$(X): $$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
stage$(1)/bin/lib/$$(CFG_STDLIB) \
$$(SREQ$(1)$(3))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)) -L stage$(2) -o $$@ $$<
$$(STAGE$(1)) -L stage$(2)/lib -o $$@ $$<
stage$(2)/lib/$$(CFG_LIBRUSTC): \
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
$$(SREQ$(2)$(3))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)) -L stage$(2)/lib --lib -o $$@ $$<
stage$(2)/lib/$$(CFG_RUNTIME): rt/$$(CFG_RUNTIME)
@$$(call E, cp: $$@)
@ -71,12 +77,6 @@ stage$(2)/lib/rustc/$(3)/main.o: rt/main.o
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@
stage$(2)/lib/rustc/$(3)/$$(CFG_LIBRUSTC): \
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
$$(SREQ$(2)$(3))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(2)) --lib -o $$@ $$<
stage$(2)/lib/rustc/$(3)/$$(CFG_STDLIB): \
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
stage$(2)/bin/rustc$$(X) \