From 35a60f765e34b6a3ac440f9203ebb348440dbec8 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 18 Jun 2019 17:49:40 +0200 Subject: [PATCH] add helper Makefile make -> make check make check -> cargo test make fmt -> cargo fmt --all make checkfmt -> cargo fmt --all -- --check ... Signed-off-by: Wolfgang Bumiller --- Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..672eb37e --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +# Shortcut for common operations: + +# By default we just run checks: +.PHONY: all +all: check + +.PHONY: check +check: + cargo test + +# Prints a diff between the current code and the one rustfmt would produce +.PHONY: fmt +checkfmt: + cargo fmt --all -- --check + +# Reformat the code (ppply the output of `make checkfmt`) +.PHONY: fmt +fmt: + cargo fmt --all + +# Doc without dependencies +.PHONY: doc +doc: + cargo doc --no-deps + +.PHONY: clean +clean: + cargo clean + +.PHONY: update +update: + cargo update