Build infra and minor build-enabling bugfixes for cargo.
This commit is contained in:
parent
fa9e3e8d9a
commit
d1fd7d49a7
|
@ -343,9 +343,10 @@ TSREQS := \
|
||||||
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
$(foreach target,$(CFG_TARGET_TRIPLES), \
|
||||||
$(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
|
$(SREQ3_T_$(target)_H_$(CFG_HOST_TRIPLE)))
|
||||||
FUZZ := $(HBIN3_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
|
FUZZ := $(HBIN3_H_$(CFG_HOST_TRIPLE))/fuzzer$(X)
|
||||||
|
CARGO := $(HBIN3_H_$(CFG_HOST_TRIPLE))/cargo$(X)
|
||||||
|
|
||||||
#all: $(SREQ3$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) $(FUZZ)
|
#all: $(SREQ3$(CFG_HOST_TRIPLE)) $(GENERATED) $(DOCS) $(FUZZ)
|
||||||
all: $(TSREQS) $(GENERATED) $(DOCS) $(FUZZ)
|
all: $(TSREQS) $(GENERATED) $(DOCS) $(FUZZ) $(CARGO)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ define CLEAN_HOST_STAGE_N
|
||||||
clean$(1)_H_$(2):
|
clean$(1)_H_$(2):
|
||||||
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustc$(X)
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/rustc$(X)
|
||||||
$(Q)rm -f $$(HBIN$(1)_H_$(2))/fuzzer$(X)
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/fuzzer$(X)
|
||||||
|
$(Q)rm -f $$(HBIN$(1)_H_$(2))/cargo$(X)
|
||||||
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUNTIME)
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUNTIME)
|
||||||
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_STDLIB)
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_STDLIB)
|
||||||
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUSTLLVM)
|
$(Q)rm -f $$(HLIB$(1)_H_$(2))/$(CFG_RUSTLLVM)
|
||||||
|
|
|
@ -52,6 +52,8 @@ PKG_FILES = \
|
||||||
$(FUZZER_INPUTS) \
|
$(FUZZER_INPUTS) \
|
||||||
$(COMPILETEST_CRATE) \
|
$(COMPILETEST_CRATE) \
|
||||||
$(COMPILETEST_INPUTS) \
|
$(COMPILETEST_INPUTS) \
|
||||||
|
$(CARGO_CRATE) \
|
||||||
|
$(CARGO_INPUTS) \
|
||||||
$(PKG_PP_EXAMPLES) \
|
$(PKG_PP_EXAMPLES) \
|
||||||
$(MKFILE_DEPS)
|
$(MKFILE_DEPS)
|
||||||
|
|
||||||
|
|
5
mk/pp.mk
5
mk/pp.mk
|
@ -4,9 +4,10 @@ ifdef PPFILES
|
||||||
else
|
else
|
||||||
PP_INPUTS = $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
|
PP_INPUTS = $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
|
||||||
$(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
|
$(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
|
||||||
$(wildcard $(S)src/test/*/*.rs \
|
$(wildcard $(S)src/test/*/*.rs \
|
||||||
$(S)src/test/*/*/*.rs) \
|
$(S)src/test/*/*/*.rs) \
|
||||||
$(wildcard $(S)src/fuzzer/*.rs)
|
$(wildcard $(S)src/fuzzer/*.rs) \
|
||||||
|
$(wildcard $(S)src/cargo/*.rs)
|
||||||
|
|
||||||
PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
|
PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
|
||||||
"no-reformat\|xfail-pretty\|xfail-test")
|
"no-reformat\|xfail-pretty\|xfail-test")
|
||||||
|
|
18
mk/tools.mk
18
mk/tools.mk
|
@ -8,6 +8,10 @@ FUZZER_INPUTS := $(wildcard $(addprefix $(S)src/fuzzer/, *.rs))
|
||||||
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
|
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
|
||||||
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
|
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
|
||||||
|
|
||||||
|
# Cargo, the package manager
|
||||||
|
CARGO_CRATE := $(S)src/cargo/cargo.rc
|
||||||
|
CARGO_INPUTS := $(wildcard $(S)src/cargo/*rs)
|
||||||
|
|
||||||
# FIXME: These are only built for the host arch. Eventually we'll
|
# FIXME: These are only built for the host arch. Eventually we'll
|
||||||
# have tools that need to built for other targets.
|
# have tools that need to built for other targets.
|
||||||
define TOOLS_STAGE_N
|
define TOOLS_STAGE_N
|
||||||
|
@ -43,6 +47,20 @@ $$(HBIN$(2)_H_$(4))/compiletest$$(X): \
|
||||||
@$$(call E, cp: $$@)
|
@$$(call E, cp: $$@)
|
||||||
$$(Q)cp $$< $$@
|
$$(Q)cp $$< $$@
|
||||||
|
|
||||||
|
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X): \
|
||||||
|
$$(CARGO_CRATE) $$(CARGO_INPUTS) \
|
||||||
|
$$(TSREQ$(1)_T_$(4)_H_$(3)) \
|
||||||
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_STDLIB) \
|
||||||
|
$$(TLIB$(1)_T_$(4)_H_$(3))/$$(CFG_LIBRUSTC)
|
||||||
|
@$$(call E, compile_and_link: $$@)
|
||||||
|
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$<
|
||||||
|
|
||||||
|
$$(HBIN$(2)_H_$(4))/cargo$$(X): \
|
||||||
|
$$(TBIN$(1)_T_$(4)_H_$(3))/cargo$$(X) \
|
||||||
|
$$(HSREQ$(2)_$(4))
|
||||||
|
@$$(call E, cp: $$@)
|
||||||
|
$$(Q)cp $$< $$@
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
$(foreach host,$(CFG_TARGET_TRIPLES), \
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
// -*- rust -*-
|
||||||
|
|
||||||
|
// cargo.rs - Rust package manager
|
||||||
|
|
||||||
|
use std;
|
||||||
|
use rustc;
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// fill-column: 78;
|
||||||
|
// indent-tabs-mode: nil
|
||||||
|
// c-basic-offset: 4
|
||||||
|
// buffer-file-coding-system: utf-8-unix
|
||||||
|
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
||||||
|
// End:
|
|
@ -1,8 +1,5 @@
|
||||||
// cargo.rs - Rust package manager
|
// cargo.rs - Rust package manager
|
||||||
|
|
||||||
use rustc;
|
|
||||||
use std;
|
|
||||||
|
|
||||||
import rustc::syntax::{ast, codemap, visit};
|
import rustc::syntax::{ast, codemap, visit};
|
||||||
import rustc::syntax::parse::parser;
|
import rustc::syntax::parse::parser;
|
||||||
|
|
||||||
|
@ -98,7 +95,7 @@ fn rest(s: str, start: uint) -> str {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_file(path: str) -> option::t<str> {
|
fn install_file(_path: str) -> option::t<str> {
|
||||||
let wd = tempfile::mkdtemp("/tmp/cargo-work-", "");
|
let wd = tempfile::mkdtemp("/tmp/cargo-work-", "");
|
||||||
ret wd;
|
ret wd;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +107,7 @@ fn cmd_install(argv: [str]) {
|
||||||
ret;
|
ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
let wd = if str::starts_with(argv[2], "file:") {
|
let _wd = if str::starts_with(argv[2], "file:") {
|
||||||
let path = rest(argv[2], 5u);
|
let path = rest(argv[2], 5u);
|
||||||
install_file(path)
|
install_file(path)
|
||||||
} else {
|
} else {
|
||||||
|
@ -132,4 +129,3 @@ fn main(argv: [str]) {
|
||||||
_ { cmd_usage(); }
|
_ { cmd_usage(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue