mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Vendor hamcrest-rust
This commit is contained in:
parent
264d4a00ca
commit
04e774e818
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -4,3 +4,6 @@
|
||||
[submodule "libs/hammer.rs"]
|
||||
path = libs/hammer.rs
|
||||
url = https://github.com/wycats/hammer.rs.git
|
||||
[submodule "libs/hamcrest-rust"]
|
||||
path = libs/hamcrest-rust
|
||||
url = https://github.com/carllerche/hamcrest-rust/
|
||||
|
43
Makefile
43
Makefile
@ -1,39 +1,48 @@
|
||||
RUSTC ?= rustc
|
||||
# RUSTC_FLAGS ?= --out-dir $(RUSTC_TARGET) -L $(RUSTC_TARGET)/libs
|
||||
|
||||
TOML_LIB := $(shell rustc --crate-file-name libs/rust-toml/src/toml/lib.rs)
|
||||
HAMMER_LIB := $(shell rustc --crate-file-name libs/hammer.rs/src/hammer.rs)
|
||||
RUSTC_FLAGS ?=
|
||||
|
||||
# Link flags to pull in dependencies
|
||||
DEPS = -L libs/hammer.rs/target -L libs/rust-toml/lib
|
||||
SRC = $(wildcard src/*.rs)
|
||||
BINS = cargo-read-manifest \
|
||||
cargo-rustc \
|
||||
cargo-verify-project
|
||||
|
||||
SRC = $(wildcard src/*.rs)
|
||||
DEPS = -L libs/hammer.rs/target -L libs/rust-toml/lib
|
||||
TOML = libs/rust-toml/lib/$(shell rustc --crate-file-name libs/rust-toml/src/toml/lib.rs)
|
||||
HAMMER = libs/hammer.rs/target/$(shell rustc --crate-type=lib --crate-file-name libs/hammer.rs/src/hammer.rs)
|
||||
HAMCREST = libs/hamcrest-rust/target/timestamp
|
||||
LIBCARGO = target/libcargo.timestamp
|
||||
BIN_TARGETS = $(patsubst %,target/%,$(BINS))
|
||||
|
||||
all: $(BIN_TARGETS)
|
||||
|
||||
# Builds the hammer dependency
|
||||
hammer:
|
||||
# === Dependencies
|
||||
|
||||
$(HAMMER): $(wildcard libs/hammer.rs/src/*.rs)
|
||||
cd libs/hammer.rs && make
|
||||
|
||||
toml:
|
||||
$(TOML): $(wildcard libs/rust-toml/src/toml/*.rs)
|
||||
cd libs/rust-toml && make
|
||||
|
||||
$(HAMCREST): $(wildcard libs/hamcrest-rust/src/*.rs)
|
||||
cd libs/hamcrest-rust && make
|
||||
|
||||
# === Cargo
|
||||
|
||||
target:
|
||||
$(LIBCARGO): $(SRC)
|
||||
mkdir -p target
|
||||
$(RUSTC) $(RUSTC_FLAGS) --out-dir target src/cargo.rs
|
||||
touch $(LIBCARGO)
|
||||
|
||||
libcargo: target $(SRC)
|
||||
$(RUSTC) --out-dir target src/cargo.rs
|
||||
libcargo: $(LIBCARGO)
|
||||
|
||||
# === Commands
|
||||
|
||||
$(BIN_TARGETS): target/%: src/bin/%.rs hammer toml libcargo
|
||||
$(RUSTC) $(DEPS) -Ltarget --out-dir target $<
|
||||
$(BIN_TARGETS): target/%: src/bin/%.rs $(HAMMER) $(TOML) $(LIBCARGO)
|
||||
$(RUSTC) $(RUSTC_FLAGS) $(DEPS) -Ltarget --out-dir target $<
|
||||
|
||||
test:
|
||||
echo "testing"
|
||||
|
||||
clean:
|
||||
rm -rf target
|
||||
@ -43,4 +52,8 @@ distclean: clean
|
||||
cd libs/hammer.rs && make clean
|
||||
cd libs/rust-toml && make clean
|
||||
|
||||
.PHONY: all clean distclean test hammer libcargo
|
||||
# Setup phony tasks
|
||||
.PHONY: all clean distclean test libcargo
|
||||
|
||||
# Disable unnecessary built-in rules
|
||||
.SUFFIXES:
|
||||
|
1
libs/hamcrest-rust
Submodule
1
libs/hamcrest-rust
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 95f531ad8c726a832f28d171bde2860c77ec7619
|
Loading…
x
Reference in New Issue
Block a user