-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
71 lines (63 loc) · 1.49 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.PHONY: setup
# Setup development environment
setup:
bash ./scripts/setup-dev.sh
.PHONY: clean
# Cleanup compilation outputs
clean:
cargo clean
.PHONY: fmt-check fmt
# Check the code format
fmt-check:
taplo fmt --check
cargo fmt --all -- --check
# Format the code
fmt:
taplo fmt
cargo fmt --all
.PHONY: clippy clippy-release
# Run rust clippy with debug profile
clippy:
cargo clippy --all-targets --all-features -- -D warnings
# Run rust clippy with release profile
clippy-release:
cargo clippy --release --all-targets --all-features -- -D warnings
.PHONY: check check-release
# Check code with debug profile
check:
cargo check
# Check code with release profile
check-release:
cargo check --release
.PHONY: build build-release
# Build all binaries with debug profile
build:
cargo build
# Build all binaries with release profile
build-release:
cargo build --release
.PHONY: test test-release
# Run all unit tests with debug profile
test:
cargo test --lib --all
# Run all unit tests with release profile
test-release:
cargo test --release --lib --all
.PHONY: help
# Show 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