From 330bc5aa1e4b1644a19b3751ee3b65c849447005 Mon Sep 17 00:00:00 2001 From: Jonathan Reem Date: Tue, 24 Jun 2014 21:44:35 -0700 Subject: [PATCH] Enabled Cargo and moved Makefile to use target. --- .gitignore | 2 +- Cargo.toml | 14 ++++++++++++++ Makefile | 38 +++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 Cargo.toml diff --git a/.gitignore b/.gitignore index 92de2ec..a707507 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -build/ TAGS doc/ +target/ diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..fec6263 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ + +[package] + +name = "anymap" +version = "0.1.0" +readme = "README.md" +authors = [ "Chris Morgan " ] +tags = ["data-structures"] + +[[lib]] + +name = "anymap" +path = "src/lib.rs" + diff --git a/Makefile b/Makefile index 3414035..4050c16 100644 --- a/Makefile +++ b/Makefile @@ -12,47 +12,47 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \ $(filter $(subst *,%,$2),$d)) SRC := $(call rwildcard,src/,*.rs) -LIB := build/$(shell rustc --crate-file-name src/lib.rs --crate-type rlib) -ifeq ($(LIB),build/) +LIB := target/$(shell rustc --crate-file-name src/lib.rs --crate-type rlib) +ifeq ($(LIB),target/) # We may not have rustc or the lib.rs file may be broken. # But don't break the rules on that account. -LIB := build/libanymap.dummy +LIB := target/libanymap.dummy endif anymap: $(LIB) $(LIB): $(SRC) - @mkdir -p build/ - $(RUSTC) $(RUSTFLAGS) src/lib.rs --out-dir=build -L build + @mkdir -p target/ + $(RUSTC) $(RUSTFLAGS) src/lib.rs --out-dir=target -L target doc/anymap/index.html: $(SRC) - $(RUSTDOC) src/lib.rs -L build + $(RUSTDOC) src/lib.rs -L target -build/test: $(SRC) - $(RUSTC) $(RUSTFLAGS) --test -o build/test src/lib.rs -L build +target/test: $(SRC) + $(RUSTC) $(RUSTFLAGS) --test -o target/test src/lib.rs -L target -build/quicktest: $(SRC) - $(RUSTC) --test -o build/quicktest src/lib.rs -L build +target/quicktest: $(SRC) + $(RUSTC) --test -o target/quicktest src/lib.rs -L target # There are no tests to run this way at present. It’s all doctests. -# test: anymap doctest build/test -# build/test --test +# test: anymap doctest target/test +# target/test --test test: anymap doctest -bench: anymap build/test - build/test --bench +bench: anymap target/test + target/test --bench doctest: $(SRC) $(LIB) - $(RUSTDOC) -L build --test src/lib.rs + $(RUSTDOC) -L target --test src/lib.rs -# Can't wait for everything to build, optimised too? OK, you can save some time here. -quicktest: build/quicktest - build/quicktest --test +# Can't wait for everything to target, optimised too? OK, you can save some time here. +quicktest: target/quicktest + target/quicktest --test docs: doc/anymap/index.html clean: - rm -rf build/ doc/ + rm -rf target/ doc/ TAGS: $(SRC) ctags -f TAGS --options="$(RUST_CTAGS)" --language=rust -R src/ -- 2.42.0