]> git.proxmox.com Git - rustc.git/blob - src/bootstrap/bin/main.rs
New upstream version 1.12.0+dfsg1
[rustc.git] / src / bootstrap / bin / main.rs
1 // Copyright 2015 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.
4 //
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.
10
11 //! rustbuild, the Rust build system
12 //!
13 //! This is the entry point for the build system used to compile the `rustc`
14 //! compiler. Lots of documentation can be found in the `README.md` file next to
15 //! this file, and otherwise documentation can be found throughout the `build`
16 //! directory in each respective module.
17
18 #![deny(warnings)]
19
20 extern crate bootstrap;
21
22 use std::env;
23
24 use bootstrap::{Flags, Config, Build};
25
26 fn main() {
27 let args = env::args().skip(1).collect::<Vec<_>>();
28 let flags = Flags::parse(&args);
29 let mut config = Config::parse(&flags.build, flags.config.clone());
30
31 // compat with `./configure` while we're still using that
32 if std::fs::metadata("config.mk").is_ok() {
33 config.update_with_config_mk();
34 }
35
36 Build::new(flags, config).build();
37 }