-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
57 lines (46 loc) · 1.05 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
.DEFAULT_GOAL = help
SHELL=bash
## Run all the tests
tests:
cargo test
## Pre-check before publishing to crate
check:
cargo clean
make check-without-clean
## Same as check but without clean
check-without-clean:
make tests
cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo check
## Watch and run test
watch-test:
cargo watch -x test
## Run the binary
run:
cargo run
## Create release binary
bin-release:
cd cnx-bin && cargo install --path . --root ~
## Setup
setup:
rustup component add rustfmt
rustup component add clippy
## Watch and run build
watch-build:
cargo watch -x build
## Watch and run binary
watch-run:
cargo watch -x run
## Show help screen.
help:
@echo "Please use \`make <target>' where <target> is one of\n\n"
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-30s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)