-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (22 loc) · 1.01 KB
/
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
.PHONY: test lint recompile release
.DEFAULT_GOAL = help
help:
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
test: ## launch tests (and doc example tests)
cargo test
lint: ## lint and format code
cargo fmt && cargo check && cargo clippy
build: ## compiles executable in target directory
cargo build
target/strip.lock:
cargo install --force cargo-strip
touch target/strip.lock
release: target/strip.lock ## create release executables
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target x86_64-pc-windows-gnu
strip target/x86_64-unknown-linux-gnu/release/tmsql
strip target/x86_64-pc-windows-gnu/release/tmsql.exe
recompile: ## compiles executable in target directory even if it already exists
cargo clean && cargo build
install: ## install zsql locally
rustc -V && cargo -V && cargo install --path .