BLUE=\033[0;34m
NC=\033[0m
.PHONY: all \
build \
build-release \
check \
check-cargo \
check-clippy \
check-fmt \
check-pre-commit \
check-updates \
clean \
doc \
format \
format-clippy \
format-fmt \
help \
install \
release \
test
all: check build test
install:
@echo "\n${BLUE}pre-commit hook install and run...${NC}\n"
pre-commit install
build:
cargo build
build-release:
cargo build --release
check-pre-commit:
pre-commit run --all-files
check-clippy:
cargo clippy
check-fmt:
cargo fmt --check
check-cargo:
cargo check
check-updates:
cargo update --dry-run --verbose
check: check-pre-commit check-clippy check-fmt check-cargo check-updates
doc:
cargo doc --no-deps --open
format-clippy:
cargo clippy --fix --allow-staged --allow-dirty
format-fmt:
cargo fmt --all
format: format-clippy format-fmt
test:
cargo test
release: check format build test build-release
clean:
@echo "\n${BLUE}Cleaning up...${NC}\n"
-rm -rf target
help:
@egrep -h '\s##\s' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; \
{printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'