CARGO := cargo
.PHONY: help check ci fmt fmt-check clippy test build build-examples doc doc-open clean
.DEFAULT_GOAL := help
help:
@printf "Lemon — useful commands:\n\n"
@grep -E '^[a-zA-Z0-9_.-]+:.*##' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
check: fmt-check clippy test build-examples
ci: check
fmt:
$(CARGO) fmt --all
fmt-check:
$(CARGO) fmt --all -- --check
clippy:
$(CARGO) clippy --all-targets -- -D warnings
test:
$(CARGO) test
build:
$(CARGO) build
build-examples:
$(CARGO) build --examples
doc:
$(CARGO) doc --no-deps
doc-open: doc
$(CARGO) doc --no-deps --open
clean:
$(CARGO) clean