2011-10-02 19:28:59 -05:00
|
|
|
# Rules for non-core tools built with the compiler, both for target
|
|
|
|
# and host architectures
|
|
|
|
|
2012-10-03 19:32:30 -05:00
|
|
|
TOOL_DRIVER := $(S)src/driver/driver.rs
|
|
|
|
|
|
|
|
FUZZER_LIB := $(S)src/libfuzzer/fuzzer.rc
|
|
|
|
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/libfuzzer/, *.rs))
|
2011-10-02 19:28:59 -05:00
|
|
|
|
|
|
|
# The test runner that runs the cfail/rfail/rpass and bench tests
|
|
|
|
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
|
|
|
|
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
|
|
|
|
|
2011-12-01 13:31:29 -06:00
|
|
|
# Cargo, the package manager
|
2012-10-03 19:32:30 -05:00
|
|
|
CARGO_LIB := $(S)src/libcargo/cargo.rc
|
2011-12-01 13:31:29 -06:00
|
|
|
CARGO_INPUTS := $(wildcard $(S)src/cargo/*rs)
|
|
|
|
|
2011-12-20 20:27:27 -06:00
|
|
|
# Rustdoc, the documentation tool
|
2012-10-03 19:32:30 -05:00
|
|
|
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rc
|
2011-12-20 20:27:27 -06:00
|
|
|
RUSTDOC_INPUTS := $(wildcard $(S)src/rustdoc/*.rs)
|
|
|
|
|
2011-10-02 19:28:59 -05:00
|
|
|
# FIXME: These are only built for the host arch. Eventually we'll
|
|
|
|
# have tools that need to built for other targets.
|
|
|
|
define TOOLS_STAGE_N
|
|
|
|
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER): \
|
|
|
|
$$(FUZZER_LIB) $$(FUZZER_INPUTS) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2011-12-05 18:46:37 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
2011-10-02 19:28:59 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X): \
|
|
|
|
$$(TOOL_DRIVER) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg fuzzer -o $$@ $$<
|
2011-10-02 19:28:59 -05:00
|
|
|
|
|
|
|
# Promote the stageN target to stageN+1 host
|
|
|
|
# FIXME: Shouldn't need to depend on host/librustc.so once
|
|
|
|
# rpath is working
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBFUZZER): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/fuzzer$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X) \
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBFUZZER) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-10-02 19:28:59 -05:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X): \
|
|
|
|
$$(COMPILETEST_CRATE) $$(COMPILETEST_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2011-12-05 18:46:37 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB)
|
2011-10-02 19:28:59 -05:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<
|
2011-10-02 19:28:59 -05:00
|
|
|
|
2011-11-21 15:11:40 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/compiletest$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X) \
|
2012-03-10 00:49:29 -06:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-10-02 19:28:59 -05:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO): \
|
|
|
|
$$(CARGO_LIB) $$(CARGO_INPUTS) \
|
2011-12-01 13:31:29 -06:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
2011-12-01 13:31:29 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X): \
|
|
|
|
$$(TOOL_DRIVER) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg cargo -o $$@ $$<
|
|
|
|
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBCARGO): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
2011-12-01 13:31:29 -06:00
|
|
|
|
|
|
|
$$(HBIN$(2)_H_$(4))/cargo$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X) \
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBCARGO) \
|
2012-03-10 00:49:29 -06:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-12-01 13:31:29 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC): \
|
|
|
|
$$(RUSTDOC_LIB) $$(RUSTDOC_INPUTS) \
|
2011-12-20 20:27:27 -06:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
2011-12-20 20:27:27 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
|
|
|
|
$$(TOOL_DRIVER) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustdoc -o $$@ $$<
|
|
|
|
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTDOC): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
2011-12-20 20:27:27 -06:00
|
|
|
|
|
|
|
$$(HBIN$(2)_H_$(4))/rustdoc$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X) \
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTDOC) \
|
2012-03-10 00:49:29 -06:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-12-20 20:27:27 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-10-02 19:28:59 -05:00
|
|
|
endef
|
|
|
|
|
2011-11-23 17:20:28 -06:00
|
|
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call TOOLS_STAGE_N,0,1,$(host),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N,1,2,$(host),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N,2,3,$(host),$(host))))
|