-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (24 loc) · 942 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SHELL := /bin/bash
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
rust-version:
@echo "Rust command-line utility versions:"
rustc --version #rust compiler
cargo --version #rust package manager
rustfmt --version #rust code formatter
rustup --version #rust toolchain manager
clippy-driver --version #rust linter
format: ## Format the code
@rustup component list | grep 'rustfmt.*installed' >/dev/null || rustup component add rustfmt
cargo fmt --quiet
lint: ## Lint the code
@command -v cargo-clippy >/dev/null 2>&1 || { echo >&2 "Installing clippy..."; rustup component add clippy; }
cargo clippy --quiet
test: ## Run the tests
cargo test --quiet
run: ## Run the binary
cargo run
release: ## Build the release version
cargo build --release
all: format lint test run ## Run all the checks and tests