summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMurilo Ijanc <[email protected]>2026-07-26 12:17:46 -0300
committerMurilo Ijanc <[email protected]>2026-07-26 12:17:46 -0300
commit4a8c3b675df4b1a6b29904fc2af60605002a7f9e (patch)
tree5c3dcc6594603d242b6a284c1601fd1ffbfcc8f4 /Makefile
downloadrust-4a8c3b675df4b1a6b29904fc2af60605002a7f9e.tar.gz
Initial importv0.1.0
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4afcb19
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,48 @@
+# Development tasks. Everything runs through `cargo`, so there is nothing to
+# install first.
+#
+# make list the targets
+# make test run the suite
+# make lint clippy + rustfmt check, no files touched
+# make build release build of the library and the CLI
+
+CARGO ?= cargo
+
+.DEFAULT_GOAL := help
+.PHONY: help test lint format build check clean doc
+
+help:
+ @echo 'Targets:'
+ @echo ' test run the test suite (unit, integration and doc tests)'
+ @echo ' lint cargo clippy -D warnings + cargo fmt --check (read-only)'
+ @echo ' format apply cargo fmt (writes)'
+ @echo ' build release build of the library and the cepis CLI'
+ @echo ' check lint + test + build, in that order'
+ @echo ' doc build the API documentation'
+ @echo ' clean remove build artefacts'
+
+test:
+ $(CARGO) test --all-targets
+ $(CARGO) test --doc
+
+# Read-only by design, so it is safe in CI and in a pre-commit hook: it reports
+# what `make format` would change without changing anything.
+lint:
+ $(CARGO) clippy --all-targets -- -D warnings
+ $(CARGO) fmt --check
+
+format:
+ $(CARGO) fmt
+
+build:
+ $(CARGO) build --release
+
+doc:
+ $(CARGO) doc --no-deps
+
+# The order matters: lint is the fastest to fail, build the slowest, so a broken
+# run reports the cheapest problem first.
+check: lint test build
+
+clean:
+ $(CARGO) clean