2012-12-11 02:32:48 +01:00
|
|
|
# Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2011-10-03 02:28:59 +02:00
|
|
|
# Rules for non-core tools built with the compiler, both for target
|
|
|
|
# and host architectures
|
|
|
|
|
2012-10-04 02:32:30 +02:00
|
|
|
FUZZER_LIB := $(S)src/libfuzzer/fuzzer.rc
|
|
|
|
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/libfuzzer/, *.rs))
|
2011-10-03 02:28:59 +02:00
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
# The test runner that runs the cfail/rfail/rpass and bxench tests
|
2011-10-03 02:28:59 +02:00
|
|
|
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
|
|
|
|
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
|
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
# Rustpkg, the package manager and build system
|
|
|
|
RUSTPKG_LIB := $(S)src/librustpkg/rustpkg.rc
|
|
|
|
RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*rs)
|
2011-12-01 20:31:29 +01:00
|
|
|
|
2011-12-21 03:27:27 +01:00
|
|
|
# Rustdoc, the documentation tool
|
2012-10-04 02:32:30 +02:00
|
|
|
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rc
|
2012-11-20 04:28:21 +01:00
|
|
|
RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
|
2011-12-21 03:27:27 +01:00
|
|
|
|
2012-10-30 02:08:36 +01:00
|
|
|
# Rusti, the JIT REPL
|
2012-11-05 01:22:05 +01:00
|
|
|
RUSTI_LIB := $(S)src/librusti/rusti.rc
|
|
|
|
RUSTI_INPUTS := $(wildcard $(S)src/librusti/*.rs)
|
2012-10-30 02:08:36 +01:00
|
|
|
|
2013-02-18 20:18:34 +01:00
|
|
|
# Rust, the convenience tool
|
|
|
|
RUST_LIB := $(S)src/librust/rust.rc
|
|
|
|
RUST_INPUTS := $(wildcard $(S)src/librust/*.rs)
|
|
|
|
|
2011-10-03 02:28:59 +02:00
|
|
|
# FIXME: These are only built for the host arch. Eventually we'll
|
|
|
|
# have tools that need to built for other targets.
|
2012-11-08 04:47:24 +01:00
|
|
|
define TOOLS_STAGE_N_TARGET
|
2011-10-03 02:28:59 +02:00
|
|
|
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER): \
|
|
|
|
$$(FUZZER_LIB) $$(FUZZER_INPUTS) \
|
2011-11-21 22:11:40 +01:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2011-12-06 01:46:37 +01:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
2011-11-21 22:11:40 +01:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
2011-10-03 02:28:59 +02:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X): \
|
2012-11-07 04:44:58 +01:00
|
|
|
$$(DRIVER_CRATE) \
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg fuzzer -o $$@ $$<
|
2011-10-03 02:28:59 +02:00
|
|
|
|
2012-11-08 04:47:24 +01:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X): \
|
|
|
|
$$(COMPILETEST_CRATE) $$(COMPILETEST_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<
|
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTPKG): \
|
|
|
|
$$(RUSTPKG_LIB) $$(RUSTPKG_INPUTS) \
|
2012-11-08 04:47:24 +01:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X): \
|
2012-11-08 04:47:24 +01:00
|
|
|
$$(DRIVER_CRATE) \
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTPKG)
|
2012-11-08 04:47:24 +01:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustpkg -o $$@ $$<
|
2012-11-08 04:47:24 +01:00
|
|
|
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC): \
|
|
|
|
$$(RUSTDOC_LIB) $$(RUSTDOC_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
|
|
|
|
$$(DRIVER_CRATE) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustdoc -o $$@ $$<
|
|
|
|
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI): \
|
|
|
|
$$(RUSTI_LIB) $$(RUSTI_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X): \
|
|
|
|
$$(DRIVER_CRATE) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rusti -o $$@ $$<
|
|
|
|
|
2013-02-18 20:18:34 +01:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUST): \
|
|
|
|
$$(RUST_LIB) $$(RUST_INPUTS) \
|
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_CORELIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
|
|
|
|
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rust$$(X): \
|
|
|
|
$$(DRIVER_CRATE) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUST)
|
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rust -o $$@ $$<
|
|
|
|
|
2012-11-08 04:47:24 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define TOOLS_STAGE_N_HOST
|
|
|
|
|
|
|
|
|
2011-10-03 02:28:59 +02: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-04 02:32:30 +02: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 $$< $$@
|
2012-11-07 09:45:42 +01:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBFUZZER_GLOB) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBFUZZER_DSYM_GLOB)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))
|
2012-10-04 02:32:30 +02:00
|
|
|
|
2011-11-21 22:11:40 +01:00
|
|
|
$$(HBIN$(2)_H_$(4))/fuzzer$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X) \
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBFUZZER) \
|
2011-11-21 22:11:40 +01:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-10-03 02:28:59 +02:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-11-21 22:11:40 +01:00
|
|
|
$$(HBIN$(2)_H_$(4))/compiletest$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X) \
|
2012-03-10 07:49:29 +01:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-10-03 02:28:59 +02:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-10-04 02:32:30 +02:00
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTPKG): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTPKG) \
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTPKG_GLOB) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTPKG_DSYM_GLOB)) \
|
2012-11-07 09:45:42 +01:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-01 20:31:29 +01:00
|
|
|
|
2013-01-14 11:55:47 +01:00
|
|
|
$$(HBIN$(2)_H_$(4))/rustpkg$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTPKG) \
|
2012-03-10 07:49:29 +01:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-12-01 20:31:29 +01:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(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 $$< $$@
|
2012-11-07 09:45:42 +01:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTDOC_GLOB) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTDOC_DSYM_GLOB)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-21 03:27:27 +01:00
|
|
|
|
|
|
|
$$(HBIN$(2)_H_$(4))/rustdoc$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X) \
|
2012-10-04 02:32:30 +02:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTDOC) \
|
2012-03-10 07:49:29 +01:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-12-21 03:27:27 +01:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-11-05 01:22:05 +01:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTI): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
2012-11-07 09:45:42 +01:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTI_GLOB) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTI_DSYM_GLOB)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-21 03:27:27 +01:00
|
|
|
|
2012-10-30 02:08:36 +01:00
|
|
|
$$(HBIN$(2)_H_$(4))/rusti$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X) \
|
2012-11-05 01:22:05 +01:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTI) \
|
2012-03-10 07:49:29 +01:00
|
|
|
$$(HSREQ$(2)_H_$(4))
|
2011-12-21 03:27:27 +01:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-02-18 20:18:34 +01:00
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUST): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUST) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUST_GLOB) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUST_DSYM_GLOB)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))
|
|
|
|
|
|
|
|
$$(HBIN$(2)_H_$(4))/rust$$(X): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rust$$(X) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUST) \
|
|
|
|
$$(HSREQ$(2)_H_$(4))
|
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-10-03 02:28:59 +02:00
|
|
|
endef
|
|
|
|
|
2011-11-24 00:20:28 +01:00
|
|
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
2012-11-08 04:47:24 +01:00
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,0,1,$(target),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,1,2,$(target),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,2,3,$(target),$(host)))))
|
|
|
|
|
|
|
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_HOST,0,1,$(host),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_HOST,1,2,$(host),$(host))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_HOST,2,3,$(host),$(host))))
|