@@ -16,30 +16,30 @@ use std::process::Command;
1616use build:: { Build , Compiler , Mode } ;
1717use build:: util:: { up_to_date, cp_r} ;
1818
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 ) {
2020 t ! ( fs:: create_dir_all( out) ) ;
2121
2222 let out = out. join ( name) ;
23- let compiler = Compiler :: new ( stage, host ) ;
23+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
2424 let src = build. src . join ( "src/doc" ) . join ( name) ;
2525 let index = out. join ( "index.html" ) ;
2626 let rustbook = build. tool ( & compiler, "rustbook" ) ;
2727 if up_to_date ( & src, & index) && up_to_date ( & rustbook, & index) {
2828 return
2929 }
30- println ! ( "Rustbook stage{} ({}) - {}" , stage, host , name) ;
30+ println ! ( "Rustbook stage{} ({}) - {}" , stage, target , name) ;
3131 let _ = fs:: remove_dir_all ( & out) ;
3232 build. run ( build. tool_cmd ( & compiler, "rustbook" )
3333 . arg ( "build" )
3434 . arg ( & src)
3535 . arg ( out) ) ;
3636}
3737
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 ) ;
4040 t ! ( fs:: create_dir_all( out) ) ;
4141
42- let compiler = Compiler :: new ( stage, host ) ;
42+ let compiler = Compiler :: new ( stage, & build . config . build ) ;
4343
4444 let favicon = build. src . join ( "src/doc/favicon.inc" ) ;
4545 let footer = build. src . join ( "src/doc/footer.inc" ) ;
@@ -105,59 +105,61 @@ pub fn standalone(build: &Build, stage: u32, host: &str, out: &Path) {
105105 }
106106}
107107
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 ) ;
111112 let out_dir = build. stage_out ( & compiler, Mode :: Libstd )
112- . join ( host ) . join ( "doc" ) ;
113+ . join ( target ) . join ( "doc" ) ;
113114 let rustdoc = build. rustdoc ( & compiler) ;
114115
115116 build. clear_if_dirty ( & out_dir, & rustdoc) ;
116117
117- let mut cargo = build. cargo ( & compiler, Mode :: Libstd , host , "doc" ) ;
118+ let mut cargo = build. cargo ( & compiler, Mode :: Libstd , target , "doc" ) ;
118119 cargo. arg ( "--manifest-path" )
119120 . arg ( build. src . join ( "src/rustc/std_shim/Cargo.toml" ) )
120121 . arg ( "--features" ) . arg ( build. std_features ( ) ) ;
121122 build. run ( & mut cargo) ;
122123 cp_r ( & out_dir, out)
123124}
124125
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 ) ;
128129 let out_dir = build. stage_out ( & compiler, Mode :: Libtest )
129- . join ( host ) . join ( "doc" ) ;
130+ . join ( target ) . join ( "doc" ) ;
130131 let rustdoc = build. rustdoc ( & compiler) ;
131132
132133 build. clear_if_dirty ( & out_dir, & rustdoc) ;
133134
134- let mut cargo = build. cargo ( & compiler, Mode :: Libtest , host , "doc" ) ;
135+ let mut cargo = build. cargo ( & compiler, Mode :: Libtest , target , "doc" ) ;
135136 cargo. arg ( "--manifest-path" )
136137 . arg ( build. src . join ( "src/rustc/test_shim/Cargo.toml" ) ) ;
137138 build. run ( & mut cargo) ;
138139 cp_r ( & out_dir, out)
139140}
140141
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 ) ;
144145 let out_dir = build. stage_out ( & compiler, Mode :: Librustc )
145- . join ( host ) . join ( "doc" ) ;
146+ . join ( target ) . join ( "doc" ) ;
146147 let rustdoc = build. rustdoc ( & compiler) ;
147148 if !up_to_date ( & rustdoc, & out_dir. join ( "rustc/index.html" ) ) {
148149 t ! ( fs:: remove_dir_all( & out_dir) ) ;
149150 }
150- let mut cargo = build. cargo ( & compiler, Mode :: Librustc , host , "doc" ) ;
151+ let mut cargo = build. cargo ( & compiler, Mode :: Librustc , target , "doc" ) ;
151152 cargo. arg ( "--manifest-path" )
152153 . arg ( build. src . join ( "src/rustc/Cargo.toml" ) )
153154 . arg ( "--features" ) . arg ( build. rustc_features ( ) ) ;
154155 build. run ( & mut cargo) ;
155156 cp_r ( & out_dir, out)
156157}
157158
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 ) ;
161163 let mut index = build. tool_cmd ( & compiler, "error_index_generator" ) ;
162164 index. arg ( "html" ) ;
163165 index. arg ( out. join ( "error-index.html" ) ) ;
0 commit comments