2012-12-10 19:32:48 -06: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-02 19:28:59 -05:00
|
|
|
# Rules for non-core tools built with the compiler, both for target
|
|
|
|
# and host architectures
|
|
|
|
|
2013-01-14 04:55:47 -06:00
|
|
|
# The test runner that runs the cfail/rfail/rpass and bxench tests
|
2013-06-10 15:00:38 -05:00
|
|
|
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rs
|
|
|
|
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*.rs)
|
2011-10-02 19:28:59 -05:00
|
|
|
|
2013-01-14 04:55:47 -06:00
|
|
|
# Rustpkg, the package manager and build system
|
2013-06-10 15:00:38 -05:00
|
|
|
RUSTPKG_LIB := $(S)src/librustpkg/rustpkg.rs
|
|
|
|
RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*.rs)
|
2011-12-01 13:31:29 -06:00
|
|
|
|
2011-12-20 20:27:27 -06:00
|
|
|
# Rustdoc, the documentation tool
|
2013-06-10 15:00:38 -05:00
|
|
|
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
|
2013-09-22 22:09:42 -05:00
|
|
|
RUSTDOC_INPUTS := $(wildcard $(addprefix $(S)src/librustdoc/, \
|
|
|
|
*.rs */*.rs */*/*.rs))
|
2011-12-20 20:27:27 -06:00
|
|
|
|
2012-10-29 20:08:36 -05:00
|
|
|
# Rusti, the JIT REPL
|
2013-06-10 15:00:38 -05:00
|
|
|
RUSTI_LIB := $(S)src/librusti/rusti.rs
|
2012-11-04 18:22:05 -06:00
|
|
|
RUSTI_INPUTS := $(wildcard $(S)src/librusti/*.rs)
|
2012-10-29 20:08:36 -05:00
|
|
|
|
2013-02-18 13:18:34 -06:00
|
|
|
# Rust, the convenience tool
|
2013-06-10 15:00:38 -05:00
|
|
|
RUST_LIB := $(S)src/librust/rust.rs
|
2013-02-18 13:18:34 -06:00
|
|
|
RUST_INPUTS := $(wildcard $(S)src/librust/*.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.
|
2012-11-07 21:47:24 -06:00
|
|
|
define TOOLS_STAGE_N_TARGET
|
2011-10-02 19:28:59 -05:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X_$(4)): \
|
2012-11-07 21:47:24 -06:00
|
|
|
$$(COMPILETEST_CRATE) $$(COMPILETEST_INPUTS) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(SREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)): \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(RUSTPKG_LIB) $$(RUSTPKG_INPUTS) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(SREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TLIB$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTPKG_GLOB_$(4)),$$(notdir $$@))
|
2013-07-30 17:40:19 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTPKG_GLOB_$(4)),$$(notdir $$@))
|
2012-11-07 21:47:24 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X_$(4)): \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(DRIVER_CRATE) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-01-14 04:55:47 -06:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustpkg -o $$@ $$<
|
2012-11-07 21:47:24 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)): \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(RUSTDOC_LIB) $$(RUSTDOC_INPUTS) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(SREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TLIB$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))
|
2013-08-17 10:37:12 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))
|
2012-11-07 21:47:24 -06:00
|
|
|
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X_$(4)): \
|
|
|
|
$$(DRIVER_CRATE) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustdoc -o $$@ $$<
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)): \
|
2012-11-07 21:47:24 -06:00
|
|
|
$$(RUSTI_LIB) $$(RUSTI_INPUTS) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(SREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4)) \
|
|
|
|
| $$(TLIB$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))
|
2013-08-17 10:37:12 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))
|
2012-11-07 21:47:24 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X_$(4)): \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(DRIVER_CRATE) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(4))/$(CFG_LIBRUSTI_$(4)) \
|
|
|
|
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
2012-11-07 21:47:24 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rusti -o $$@ $$<
|
|
|
|
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUST_$(4)): \
|
|
|
|
$$(RUST_LIB) $$(RUST_INPUTS) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(SREQ$(1)_T_$(4)_H_$(3)) \
|
2013-05-13 12:47:05 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)) \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4)) \
|
|
|
|
| $$(TLIB$(1)_T_$(4)_H_$(3))/
|
2013-02-18 13:18:34 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))
|
2013-08-17 10:37:12 -05:00
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) --out-dir $$(@D) $$< && touch $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))
|
2013-02-18 13:18:34 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rust$$(X_$(4)): \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(DRIVER_CRATE) \
|
Add dependence arc from running rustc to its libraries.
This commit fixes some oversights in the Makefile where rustc could be
invoked without some of its dependencies yet in place. (I encountered
the problem in practice; its not just theoretical.)
As written in Makefile.in, $(STAGE$(1)_T_$(2)_H_$(3)) is the way one
writes an invocation of rustc where $(1) is the stage number $(2) is
the target triple $(3) is the host triple. (Other uses of the macro
may plug in actual values or different parameters in for those three
formal parameters.)
When you have invocations of $(STAGE...), you need to make sure that
its dependences are satisfied; otherwise, if someone is using `make
-jN` for certain (large-ish) `N`, one can encounter situations where
GNU make attempts to invoke `rustc` before it has actually copied some
of its libraries into place, such as libmorestack.a, which causes a
link failure when the rustc invocation attempts to link in those
libraries.
In this case, the main prerequisite to add is TSREQ$(1)_T_$(2)_H_$(3),
which is described in Makefile.in as "Prerequisites for using the
stageN compiler to build target artifacts"
----
In addition to adding the extra dependences on TSREQ..., I also
replaced occurrences of the pattern:
TSREQ$(1)_T_$(2)_H_$(3)
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2))
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2))
with:
SREQ$(1)_T_$(2)_H_$(3)
which is equivalent to the above, as defined in Makefile.in
----
Finally, for the cases where TSREQ was missing in tests.mk, I went
ahead and put in a dependence on SREQ rather than just TSREQ, since it
was not clear to me how one could expect to compile those cases
without stdlib and extralib.
(It could well be that I should have gone ahead and done the same in
other cases where I saw TSREQ was missing, and put SREQ in those
cases as well. But this seemed like a good measure for now, without
needing to tax my understanding of the overall makefile
infrastructure much further.)
2013-07-16 01:05:18 -05:00
|
|
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUST_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(TBIN$(1)_T_$(4)_H_$(3))/
|
2013-02-18 13:18:34 -06:00
|
|
|
@$$(call E, compile_and_link: $$@)
|
|
|
|
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rust -o $$@ $$<
|
|
|
|
|
2012-11-07 21:47:24 -06:00
|
|
|
endef
|
|
|
|
|
|
|
|
define TOOLS_STAGE_N_HOST
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/compiletest$$(X_$(4)): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/compiletest$$(X_$(4)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2011-10-02 19:28:59 -05:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2012-10-03 19:32:30 -05:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTPKG_$(4)): \
|
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
|
|
|
| $$(HLIB$(2)_H_$(4))/
|
2012-10-03 19:32:30 -05:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTPKG_GLOB_$(4)),$$(notdir $$@))
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(Q)cp $$< $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTPKG_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTPKG_GLOB_$(4)) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTPKG_DSYM_GLOB_$(4))) \
|
2012-11-07 02:45:42 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-01 13:31:29 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/rustpkg$$(X_$(4)): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X_$(4)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTPKG_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2011-12-01 13:31:29 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTDOC_$(4)): \
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTDOC_$(4)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTC_$(4)) \
|
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(HLIB$(2)_H_$(4))/
|
2012-10-03 19:32:30 -05:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))
|
2012-10-03 19:32:30 -05:00
|
|
|
$$(Q)cp $$< $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTDOC_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTDOC_GLOB_$(4)) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTDOC_DSYM_GLOB_$(4))) \
|
2012-11-07 02:45:42 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-20 20:27:27 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/rustdoc$$(X_$(4)): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X_$(4)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTDOC_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2011-12-20 20:27:27 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTI_$(4)): \
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTI_$(4)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTC_$(4)) \
|
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
| $$(HLIB$(2)_H_$(4))/
|
2012-11-04 18:22:05 -06:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))
|
2012-11-04 18:22:05 -06:00
|
|
|
$$(Q)cp $$< $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUSTI_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTI_GLOB_$(4)) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTI_DSYM_GLOB_$(4))) \
|
2012-11-07 02:45:42 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
2011-12-20 20:27:27 -06:00
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/rusti$$(X_$(4)): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X_$(4)) \
|
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTI_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2011-12-20 20:27:27 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUST_$(4)): \
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUST_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUSTC_$(4)) \
|
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
|
|
|
| $$(HLIB$(2)_H_$(4))/
|
2013-02-18 13:18:34 -06:00
|
|
|
@$$(call E, cp: $$@)
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))
|
2013-02-18 13:18:34 -06:00
|
|
|
$$(Q)cp $$< $$@
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(call LIST_ALL_OLD_GLOB_MATCHES_EXCEPT,$$(dir $$@),$(LIBRUST_GLOB_$(4)),$$(notdir $$@))
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUST_GLOB_$(4)) \
|
|
|
|
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUST_DSYM_GLOB)_$(4)) \
|
2013-02-18 13:18:34 -06:00
|
|
|
$$(HLIB$(2)_H_$(4))
|
|
|
|
|
2013-03-02 06:25:12 -06:00
|
|
|
$$(HBIN$(2)_H_$(4))/rust$$(X_$(4)): \
|
|
|
|
$$(TBIN$(1)_T_$(4)_H_$(3))/rust$$(X_$(4)) \
|
2013-07-08 11:35:47 -05:00
|
|
|
$$(HLIB$(2)_H_$(4))/$(CFG_LIBRUST_$(4)) \
|
2013-07-04 09:51:45 -05:00
|
|
|
$$(HSREQ$(2)_H_$(4)) \
|
|
|
|
| $$(HBIN$(2)_H_$(4))/
|
2013-02-18 13:18:34 -06:00
|
|
|
@$$(call E, cp: $$@)
|
|
|
|
$$(Q)cp $$< $$@
|
|
|
|
|
2011-10-02 19:28:59 -05:00
|
|
|
endef
|
|
|
|
|
2013-02-21 18:15:01 -06:00
|
|
|
$(foreach host,$(CFG_HOST_TRIPLES), \
|
2012-11-07 21:47:24 -06:00
|
|
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
2013-02-21 18:15:01 -06:00
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,0,1,$(host),$(target))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,1,2,$(host),$(target))) \
|
2013-06-27 20:57:38 -05:00
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,2,3,$(host),$(target))) \
|
|
|
|
$(eval $(call TOOLS_STAGE_N_TARGET,3,bogus,$(host),$(target)))))
|
2012-11-07 21:47:24 -06:00
|
|
|
|
2013-02-21 18:15:01 -06:00
|
|
|
$(foreach host,$(CFG_HOST_TRIPLES), \
|
2012-11-07 21:47:24 -06:00
|
|
|
$(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))))
|