1 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
11 ################################################################################
12 # Rust's standard distribution of crates and tools
14 # The crates outlined below are the standard distribution of libraries provided
15 # in a rust installation. These rules are meant to abstract over the
16 # dependencies (both native and rust) of crates and basically generate all the
17 # necessary makefile rules necessary to build everything.
19 # Here's an explanation of the variables below
22 # This list of crates will be built for all targets, including
23 # cross-compiled targets
26 # This list of crates will be compiled for only host targets. Note that
27 # this set is explicitly *not* a subset of TARGET_CRATES, but rather it is
28 # a disjoint set. Nothing in the TARGET_CRATES set can depend on crates in
29 # the HOST_CRATES set, but the HOST_CRATES set can depend on target
33 # A list of all tools which will be built as part of the compilation
34 # process. It is currently assumed that most tools are built through
35 # src/driver/driver.rs with a particular configuration (there's a
36 # corresponding library providing the implementation)
39 # These lists are the dependencies of the <crate> that is to be built.
40 # Rust dependencies are listed bare (i.e. std) and native
41 # dependencies have a "native:" prefix (i.e. native:hoedown). All deps
42 # will be built before the crate itself is built.
44 # TOOL_DEPS_<tool>/TOOL_SOURCE_<tool>
45 # Similar to the DEPS variable, this is the library crate dependencies
46 # list for tool as well as the source file for the specified tool
48 # You shouldn't need to modify much other than these variables. Crates are
49 # automatically generated for all stage/host/target combinations.
50 ################################################################################
52 TARGET_CRATES
:= libc std flate arena term \
53 serialize getopts collections
test rand \
54 log graphviz core rbml alloc \
55 rustc_unicode rustc_bitflags \
57 RUSTC_CRATES
:= rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
58 rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59 rustc_data_structures rustc_front rustc_platform_intrinsics \
60 rustc_plugin rustc_metadata rustc_passes
61 HOST_CRATES
:= syntax syntax_ext
$(RUSTC_CRATES
) rustdoc fmt_macros
62 TOOLS
:= compiletest rustdoc rustc rustbook error-index-generator
65 DEPS_alloc
:= core libc alloc_system
66 DEPS_alloc_system
:= core libc
67 DEPS_collections
:= core alloc rustc_unicode
70 DEPS_rustc_bitflags
:= core
71 DEPS_rustc_unicode
:= core
73 DEPS_std
:= core libc rand alloc collections rustc_unicode \
78 DEPS_flate
:= std native
:miniz
84 DEPS_rbml
:= std log serialize
85 DEPS_serialize
:= std log
87 DEPS_test
:= std getopts serialize rbml term native
:rust_test_helpers
89 DEPS_syntax
:= std term serialize log arena libc rustc_bitflags
90 DEPS_syntax_ext
:= syntax fmt_macros
92 DEPS_rustc
:= syntax fmt_macros flate arena serialize getopts rbml rustc_front\
93 log graphviz rustc_llvm rustc_back rustc_data_structures
94 DEPS_rustc_back
:= std syntax rustc_llvm rustc_front flate log libc
95 DEPS_rustc_borrowck
:= rustc rustc_front log graphviz syntax
96 DEPS_rustc_data_structures
:= std log serialize
97 DEPS_rustc_driver
:= arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
98 rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
99 rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
100 rustc_metadata syntax_ext rustc_passes
101 DEPS_rustc_front
:= std syntax log serialize
102 DEPS_rustc_lint
:= rustc log syntax
103 DEPS_rustc_llvm
:= native
:rustllvm libc std rustc_bitflags
104 DEPS_rustc_metadata
:= rustc rustc_front syntax rbml
105 DEPS_rustc_passes
:= syntax rustc core
106 DEPS_rustc_mir
:= rustc rustc_front syntax
107 DEPS_rustc_resolve
:= arena rustc rustc_front log syntax
108 DEPS_rustc_platform_intrinsics
:= rustc rustc_llvm
109 DEPS_rustc_plugin
:= rustc rustc_metadata syntax
110 DEPS_rustc_privacy
:= rustc rustc_front log syntax
111 DEPS_rustc_trans
:= arena flate getopts graphviz libc rustc rustc_back rustc_mir \
112 log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
113 DEPS_rustc_typeck
:= rustc syntax rustc_front rustc_platform_intrinsics
115 DEPS_rustdoc
:= rustc rustc_driver native
:hoedown serialize getopts \
116 test rustc_lint rustc_front
119 TOOL_DEPS_compiletest
:= test getopts
120 TOOL_DEPS_rustdoc
:= rustdoc
121 TOOL_DEPS_rustc
:= rustc_driver
122 TOOL_DEPS_rustbook
:= std rustdoc
123 TOOL_DEPS_error-index-generator
:= rustdoc syntax serialize
124 TOOL_SOURCE_compiletest
:= $(S
)src
/compiletest
/compiletest.rs
125 TOOL_SOURCE_rustdoc
:= $(S
)src
/driver
/driver.rs
126 TOOL_SOURCE_rustc
:= $(S
)src
/driver
/driver.rs
127 TOOL_SOURCE_rustbook
:= $(S
)src
/rustbook
/main.rs
128 TOOL_SOURCE_error-index-generator
:= $(S
)src
/error-index-generator
/main.rs
134 ONLY_RLIB_collections
:= 1
135 ONLY_RLIB_rustc_unicode
:= 1
136 ONLY_RLIB_rustc_bitflags
:= 1
137 ONLY_RLIB_alloc_system
:= 1
139 # Documented-by-default crates
140 DOC_CRATES
:= std alloc collections core libc rustc_unicode
142 ifeq ($(CFG_DISABLE_JEMALLOC
),)
143 TARGET_CRATES
+= alloc_jemalloc
144 DEPS_std
+= alloc_jemalloc
145 DEPS_alloc_jemalloc
:= core libc native
:jemalloc
146 ONLY_RLIB_alloc_jemalloc
:= 1
148 RUSTFLAGS_rustc_back
:= --cfg disable_jemalloc
151 ################################################################################
152 # You should not need to edit below this line
153 ################################################################################
155 CRATES
:= $(TARGET_CRATES
) $(HOST_CRATES
)
157 # This macro creates some simple definitions for each crate being built, just
158 # some munging of all of the parameters above.
160 # $(1) is the crate to generate variables for
162 CRATEFILE_
$(1) := $$(SREL
)src
/lib
$(1)/lib.rs
163 RSINPUTS_
$(1) := $$(call rwildcard
,$(S
)src
/lib
$(1)/,*.rs
)
164 RUST_DEPS_
$(1) := $$(filter-out native
:%,$$(DEPS_
$(1)))
165 NATIVE_DEPS_
$(1) := $$(patsubst native
:%,%,$$(filter native
:%,$$(DEPS_
$(1))))
168 $(foreach crate
,$(CRATES
),$(eval
$(call RUST_CRATE
,$(crate
))))
170 # Similar to the macro above for crates, this macro is for tools
172 # $(1) is the crate to generate variables for
174 TOOL_INPUTS_
$(1) := $$(call rwildcard
,$$(dir $$(TOOL_SOURCE_
$(1))),*.rs
)
177 $(foreach crate
,$(TOOLS
),$(eval
$(call RUST_TOOL
,$(crate
))))
179 CRATEFILE_libc
:= $(SREL
)src
/liblibc
/src
/lib.rs
180 RUSTFLAGS_libc
:= --cfg stdbuild