-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (79 loc) · 1.93 KB
/
Makefile
File metadata and controls
99 lines (79 loc) · 1.93 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.PHONY: help \
upgrade \
lint \
lint-audit \
audit-fix \
test \
coverage \
check \
find-msrv \
verify-msrv \
clean \
prepare \
build \
build-no-audit \
doc \
doc-public \
watch-doc \
doc-deps
.DEFAULT_GOAL=help
# Parameters
APP_NAME="ESC/POS printer driver"
CARGO=cargo
help: Makefile
@echo
@echo "Choose a command run in "$(APP_NAME)":"
@echo
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo
## upgrade: Upgrade crates
upgrade:
$(CARGO) upgrade
$(CARGO) update
## lint: Run clippy and rustfmt
lint:
$(CARGO) fmt
$(CARGO) clippy --all-features -- -D warnings
## lint-audit: Run clippy, rustfmt and audit
lint-audit: lint
$(CARGO) audit
## audit-fix: Fix audit
audit-fix:
$(CARGO) audit fix
## test: Launch unit tests in a single thread
test:
$(CARGO) test --all-features -- --nocapture
## coverage: Launch coverage tests
coverage:
$(CARGO) tarpaulin --all-features
## check: Clippy, audit and test
check: lint-audit test
## find-msrv: Find minimum supported Rust version
find-msrv:
$(CARGO) msrv find
## verify-msrv: Verify minimum supported Rust version
verify-msrv:
$(CARGO) msrv verify
## clean: Remove target directory
clean:
$(CARGO) clean
## prepare: Run lint, test and verify-msrv
prepare: lint test verify-msrv
## build: Build application in release mode
build: lint-audit test
$(CARGO) build --release
## build-no-audit: Build application in release mode
build-no-audit: lint test
$(CARGO) build --release
## doc: Open Rust documentation without dependencies
doc:
$(CARGO) doc --open --no-deps --all-features
## doc-public: Open Rust documentation without dependencies
doc-public:
$(CARGO) doc --open --document-private-items --no-deps --all-features
## watch-doc: Watch Rust documentation without dependencies
watch-doc: doc
$(CARGO) watch -x 'doc --no-deps --all-features'
## doc: Open Rust documentation with dependencies
doc-deps:
$(CARGO) doc --open --document-private-items --all-features