Skip to content

Commit

Permalink
Rename src/rustc to src/librustc. Use the driver crate
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Nov 7, 2012
1 parent f72ef31 commit 69a8b4d
Show file tree
Hide file tree
Showing 112 changed files with 28 additions and 36 deletions.
9 changes: 4 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,15 @@ STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
# rustc crate variables
######################################################################

COMPILER_CRATE := $(S)src/rustc/rustc.rc
COMPILER_INPUTS := $(filter-out $(S)src/rustc/driver/rustc.rs, \
$(wildcard $(addprefix $(S)src/rustc/, \
rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs)))
COMPILER_CRATE := $(S)src/librustc/rustc.rc
COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs))

LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rc
LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
syntax.rc *.rs */*.rs */*/*.rs))

RUSTC_INPUTS := $(S)src/rustc/driver/rustc.rs
DRIVER_CRATE := $(S)src/driver/driver.rs

######################################################################
# LLVM macros
Expand Down
20 changes: 10 additions & 10 deletions mk/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_RUSTLLVM): \
@$$(call E, cp: $$@)
$$(Q)cp $$< $$@

$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
$$(RUSTC_INPUTS) \
$$(TLIBRUSTC_DEFAULT$(1)_T_$(2)_H_$(3))
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$<
ifdef CFG_ENABLE_PAX_FLAGS
@$$(call E, apply PaX flags: $$@)
@"$(CFG_PAXCTL)" -cm "$$@"
endif

$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC): \
$$(COMPILER_CRATE) $$(COMPILER_INPUTS) \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@

$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X): \
$$(DRIVER_CRATE) \
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(2)_H_$(3)) --cfg rustc -o $$@ $$<
ifdef CFG_ENABLE_PAX_FLAGS
@$$(call E, apply PaX flags: $$@)
@"$(CFG_PAXCTL)" -cm "$$@"
endif

$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX): \
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
Expand Down
10 changes: 4 additions & 6 deletions mk/tools.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Rules for non-core tools built with the compiler, both for target
# and host architectures

TOOL_DRIVER := $(S)src/driver/driver.rs

FUZZER_LIB := $(S)src/libfuzzer/fuzzer.rc
FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/libfuzzer/, *.rs))

Expand Down Expand Up @@ -36,7 +34,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER): \
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/fuzzer$$(X): \
$$(TOOL_DRIVER) \
$$(DRIVER_CRATE) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBFUZZER)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg fuzzer -o $$@ $$<
Expand Down Expand Up @@ -82,7 +80,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO): \
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X): \
$$(TOOL_DRIVER) \
$$(DRIVER_CRATE) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBCARGO)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg cargo -o $$@ $$<
Expand Down Expand Up @@ -111,7 +109,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC): \
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/rustdoc$$(X): \
$$(TOOL_DRIVER) \
$$(DRIVER_CRATE) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTDOC)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rustdoc -o $$@ $$<
Expand Down Expand Up @@ -140,7 +138,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI): \
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@

$$(TBIN$(1)_T_$(4)_H_$(3))/rusti$$(X): \
$$(TOOL_DRIVER) \
$$(DRIVER_CRATE) \
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTI)
@$$(call E, compile_and_link: $$@)
$$(STAGE$(1)_T_$(4)_H_$(3)) --cfg rusti -o $$@ $$<
Expand Down
3 changes: 3 additions & 0 deletions src/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ extern mod self(name = "rustdoc", vers = "0.5");
#[cfg(rusti)]
extern mod self(name = "rusti", vers = "0.5");

#[cfg(rustc)]
extern mod self(name = "rustc", vers = "0.5");

fn main() { self::main() }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 7 additions & 15 deletions src/rustc/driver/rustc.rs → src/librustc/rustc.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
#[no_core];
#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
#[legacy_modes];

extern mod core(vers = "0.5");
extern mod std(vers = "0.5");
extern mod rustc(vers = "0.5");
extern mod syntax(vers = "0.5");

use core::*;

// -*- rust -*-
use result::{Ok, Err};
use io::ReaderUtil;
use std::getopts;
use std::map::HashMap;
use getopts::{opt_present};
use getopts::groups;
use rustc::driver::driver::*;
use syntax::codemap;
use syntax::diagnostic;
use rustc::driver::session;
use rustc::middle::lint;
use driver::driver::{host_triple, optgroups, early_error,
str_input, file_input, build_session_options,
build_session, build_configuration, parse_pretty,
pp_mode, pretty_print_input, list_metadata,
compile_input};
use driver::session;
use middle::lint;

fn version(argv0: &str) {
let mut vers = ~"unknown version";
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 69a8b4d

Please sign in to comment.