.PHONY: setup
setup:
rustup component add rustfmt clippy
cargo fetch
.PHONY: clean
clean:
cargo clean
.PHONY: fmt-check fmt
fmt-check:
cargo fmt --all -- --check
fmt:
cargo fmt --all
.PHONY: clippy clippy-release
clippy:
cargo clippy --all --all-targets -- -D warnings
clippy-release:
cargo clippy --release --all --all-targets -- -D warnings
.PHONY: check check-release
check:
cargo check
check-release:
cargo check --release
.PHONY: build build-release
build:
cargo build
build-release:
cargo build --release
.PHONY: test test-release
test:
cargo test --all
test-release:
cargo test --release --all
.PHONY: install
install:
cargo install --path .
.PHONY: lint
lint:
cargo run -- lint .
.PHONY: new-skill
new-skill:
cargo run -- new $(NAME) --lang $(or $(LANG),python)
.PHONY: ci
ci: fmt-check clippy test build
.PHONY: doc
doc:
cargo doc --no-deps --open
.PHONY: help
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-30s\033[0m %s\n", helpCommand,helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help