From 0c58b5dd8420c8e41dc1e98cb4fcb1109db30651 Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Mon, 25 Jan 2021 16:15:46 +0800 Subject: [PATCH] Add Makefile So we can use make to build, check and test Signed-off-by: Tim Zhang --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89fe2a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +all: debug fmt test + +# +# Build +# + +.PHONY: debug +debug: + RUSTFLAGS="--deny warnings" cargo build + +.PHONY: release +release: + cargo build --release + +.PHONY: build +build: debug + +# +# Tests and linters +# + +.PHONY: test +test: + cargo test -- --color always --nocapture + +.PHONY: check +check: fmt clippy + + +.PHONY: fmt +fmt: + cargo fmt --all -- --check + +.PHONY: clippy +clippy: + cargo clippy --all-targets --all-features -- -D warnings +