6 import std::getopts::optopt;
7 import std::getopts::opt_present;
8 import std::getopts::opt_str;
14 import rustc::back::link;
15 import rustc::syntax::ast;
16 import driver = rustc::driver::rustc; // see https://github.com/graydon/rust/issues/624
17 import rustc::driver::session;
20 fn find_rust_files(&mutable str[] files, str root) {
21 for (str filename in fs::list_dir(root)) {
22 if (str::ends_with(filename, ".rs")) {
28 fn main(vec[str] args) {
30 auto root = "/Users/jruderman/code/rust/src/lib/"; // XXX
31 find_rust_files(files, root); // not using driver::time here because that currently screws with passing-a-mutable-array
33 auto binary = vec::shift[str](args);
34 auto binary_dir = fs::dirname(binary);
36 let @session::options sopts =
46 time_llvm_passes=false,
47 output_type=link::output_type_bitcode,
48 library_search_paths=[binary_dir + "/lib"],
49 sysroot=driver::get_default_sysroot(binary),
53 let session::session sess = driver::build_session(sopts);
55 log_err ivec::len(files);
56 for (str file in files) {
58 // Can't use parse_input here because of https://github.com/graydon/rust/issues/632 :(
59 //auto crate = driver::parse_input(sess, ~[], file);
60 //let @ast::crate crate = driver::time(true, "parsing " + file, bind driver::parse_input(sess, ~[], file));
67 // indent-tabs-mode: nil
69 // buffer-file-coding-system: utf-8-unix
70 // compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";