@@ -16,30 +16,30 @@ use std::process::Command;
16
16
use build:: { Build , Compiler , Mode } ;
17
17
use build:: util:: { up_to_date, cp_r} ;
18
18
19
- pub fn rustbook ( build : & Build , stage : u32 , host : & str , name : & str , out : & Path ) {
19
+ pub fn rustbook ( build : & Build , stage : u32 , target : & str , name : & str , out : & Path ) {
20
20
t ! ( fs:: create_dir_all( out) ) ;
21
21
22
22
let out = out. join ( name) ;
23
- let compiler = Compiler :: new ( stage, host ) ;
23
+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
24
24
let src = build. src . join ( "src/doc" ) . join ( name) ;
25
25
let index = out. join ( "index.html" ) ;
26
26
let rustbook = build. tool ( & compiler, "rustbook" ) ;
27
27
if up_to_date ( & src, & index) && up_to_date ( & rustbook, & index) {
28
28
return
29
29
}
30
- println ! ( "Rustbook stage{} ({}) - {}" , stage, host , name) ;
30
+ println ! ( "Rustbook stage{} ({}) - {}" , stage, target , name) ;
31
31
let _ = fs:: remove_dir_all ( & out) ;
32
32
build. run ( build. tool_cmd ( & compiler, "rustbook" )
33
33
. arg ( "build" )
34
34
. arg ( & src)
35
35
. arg ( out) ) ;
36
36
}
37
37
38
- pub fn standalone ( build : & Build , stage : u32 , host : & str , out : & Path ) {
39
- println ! ( "Documenting stage{} standalone ({})" , stage, host ) ;
38
+ pub fn standalone ( build : & Build , stage : u32 , target : & str , out : & Path ) {
39
+ println ! ( "Documenting stage{} standalone ({})" , stage, target ) ;
40
40
t ! ( fs:: create_dir_all( out) ) ;
41
41
42
- let compiler = Compiler :: new ( stage, host ) ;
42
+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
43
43
44
44
let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
45
45
let footer = build. src . join ( "src/doc/footer.inc" ) ;
@@ -105,59 +105,61 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
105
105
}
106
106
}
107
107
108
- pub fn std ( build : & Build , stage : u32 , host : & str , out : & Path ) {
109
- println ! ( "Documenting stage{} std ({})" , stage, host) ;
110
- let compiler = Compiler :: new ( stage, host) ;
108
+ pub fn std ( build : & Build , stage : u32 , target : & str , out : & Path ) {
109
+ println ! ( "Documenting stage{} std ({})" , stage, target) ;
110
+ t ! ( fs:: create_dir_all( out) ) ;
111
+ let compiler = Compiler :: new ( stage, & build. config . build ) ;
111
112
let out_dir = build. stage_out ( & compiler, Mode :: Libstd )
112
- . join ( host ) . join ( "doc" ) ;
113
+ . join ( target ) . join ( "doc" ) ;
113
114
let rustdoc = build. rustdoc ( & compiler) ;
114
115
115
116
build. clear_if_dirty ( & out_dir, & rustdoc) ;
116
117
117
- let mut cargo = build. cargo ( & compiler, Mode :: Libstd , host , "doc" ) ;
118
+ let mut cargo = build. cargo ( & compiler, Mode :: Libstd , target , "doc" ) ;
118
119
cargo. arg ( "--manifest-path" )
119
120
. arg ( build. src . join ( "src/rustc/std_shim/Cargo.toml" ) )
120
121
. arg ( "--features" ) . arg ( build. std_features ( ) ) ;
121
122
build. run ( & mut cargo) ;
122
123
cp_r ( & out_dir, out)
123
124
}
124
125
125
- pub fn test ( build : & Build , stage : u32 , host : & str , out : & Path ) {
126
- println ! ( "Documenting stage{} test ({})" , stage, host ) ;
127
- let compiler = Compiler :: new ( stage, host ) ;
126
+ pub fn test ( build : & Build , stage : u32 , target : & str , out : & Path ) {
127
+ println ! ( "Documenting stage{} test ({})" , stage, target ) ;
128
+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
128
129
let out_dir = build. stage_out ( & compiler, Mode :: Libtest )
129
- . join ( host ) . join ( "doc" ) ;
130
+ . join ( target ) . join ( "doc" ) ;
130
131
let rustdoc = build. rustdoc ( & compiler) ;
131
132
132
133
build. clear_if_dirty ( & out_dir, & rustdoc) ;
133
134
134
- let mut cargo = build. cargo ( & compiler, Mode :: Libtest , host , "doc" ) ;
135
+ let mut cargo = build. cargo ( & compiler, Mode :: Libtest , target , "doc" ) ;
135
136
cargo. arg ( "--manifest-path" )
136
137
. arg ( build. src . join ( "src/rustc/test_shim/Cargo.toml" ) ) ;
137
138
build. run ( & mut cargo) ;
138
139
cp_r ( & out_dir, out)
139
140
}
140
141
141
- pub fn rustc ( build : & Build , stage : u32 , host : & str , out : & Path ) {
142
- println ! ( "Documenting stage{} compiler ({})" , stage, host ) ;
143
- let compiler = Compiler :: new ( stage, host ) ;
142
+ pub fn rustc ( build : & Build , stage : u32 , target : & str , out : & Path ) {
143
+ println ! ( "Documenting stage{} compiler ({})" , stage, target ) ;
144
+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
144
145
let out_dir = build. stage_out ( & compiler, Mode :: Librustc )
145
- . join ( host ) . join ( "doc" ) ;
146
+ . join ( target ) . join ( "doc" ) ;
146
147
let rustdoc = build. rustdoc ( & compiler) ;
147
148
if !up_to_date ( & rustdoc, & out_dir. join ( "rustc/index.html" ) ) {
148
149
t ! ( fs:: remove_dir_all( & out_dir) ) ;
149
150
}
150
- let mut cargo = build. cargo ( & compiler, Mode :: Librustc , host , "doc" ) ;
151
+ let mut cargo = build. cargo ( & compiler, Mode :: Librustc , target , "doc" ) ;
151
152
cargo. arg ( "--manifest-path" )
152
153
. arg ( build. src . join ( "src/rustc/Cargo.toml" ) )
153
154
. arg ( "--features" ) . arg ( build. rustc_features ( ) ) ;
154
155
build. run ( & mut cargo) ;
155
156
cp_r ( & out_dir, out)
156
157
}
157
158
158
- pub fn error_index ( build : & Build , stage : u32 , host : & str , out : & Path ) {
159
- println ! ( "Documenting stage{} error index ({})" , stage, host) ;
160
- let compiler = Compiler :: new ( stage, host) ;
159
+ pub fn error_index ( build : & Build , stage : u32 , target : & str , out : & Path ) {
160
+ println ! ( "Documenting stage{} error index ({})" , stage, target) ;
161
+ t ! ( fs:: create_dir_all( out) ) ;
162
+ let compiler = Compiler :: new ( stage, & build. config . build ) ;
161
163
let mut index = build. tool_cmd ( & compiler, "error_index_generator" ) ;
162
164
index. arg ( "html" ) ;
163
165
index. arg ( out. join ( "error-index.html" ) ) ;
0 commit comments