-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
75 lines (51 loc) · 1.44 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
72
73
74
75
CARGO ?= cargo
RUSTUP ?= rustup
help: Makefile
@echo
@echo " Choose a command to run in Buzzard:"
@echo
@sed -n 's/^##//p' $< | awk -F ':' '{printf " %-25s %s\n", $$1, $$2}'
@echo
## config: Install dependencies.
config:
$(RUSTUP) component add rustfmt
## build: Build binary
build:
@echo "\n>> ============= Cargo Build ============= <<"
rm -rf target
$(CARGO) build --verbose --all
## version: Show version of cargo and rustup
version:
@echo "\n>> ============= Cargo Version ============= <<"
$(CARGO) --version
@echo "\n>> ============= Rustup Version ============= <<"
$(RUSTUP) --version
## release: Build releases
release:
@echo "\n>> ============= Cargo Release ============= <<"
rm -rf target
$(CARGO) build --release --verbose
## test: Run test cases
test:
@echo "\n>> ============= Cargo Test ============= <<"
$(CARGO) test --verbose --all
## fmt: Format code
fmt:
@echo "\n>> ============= Cargo Format ============= <<"
$(CARGO) fmt
## fmt_check: Check format
fmt_check:
@echo "\n>> ============= Cargo Format Check ============= <<"
$(CARGO) fmt -- --check
## run: Run project
run:
@echo "\n>> ============= Cargo Run ============= <<"
$(CARGO) run
## ci: Run all CI tests.
ci: build test fmt_check
@echo "\n>> ============= All quality checks passed ============= <<"
## clean: Clean build artifacts
clean:
@echo "\n>> ============= Cleaning build artifacts ============= <<"
rm -rf target
.PHONY: help