-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.3 KB
/
Makefile
File metadata and controls
51 lines (40 loc) · 1.3 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
ifeq ($(shell uname -s), Darwin)
CPU_CORES = $(shell sysctl -n hw.ncpu)
else
CPU_CORES = $(shell grep -c processor /proc/cpuinfo)
endif
.PHONY: help
help: ## show help message.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: check
check: ## check compile is succeed
@cargo check -j $(CPU_CORES) --lib --bins --tests
.PHONY: build
build: ## build application (This command cannot update Cargo.toml)
@cargo test -j $(CPU_CORES) --no-run --locked
.PHONY: update_cargo
update_cargo: ## build application
@cargo test -j $(CPU_CORES) --no-run
.PHONY: release
release: ## build release binary using musl
@cargo build --release --target x86_64-unknown-linux-musl
.PHONY: run
run: ## run: cargo run
@make build
@cargo run --quiet -j $(CPU_CORES) -- $(ARGS)
.PHONY: run_release
run_release: ## run: cargo build --release and run binary
@make release
@./target/x86_64-unknown-linux-musl/release/slack_upload_cli $(ARGS)
.PHONY: test
test: ## run: only unit test
@cargo test --lib
.PHONY: test_debug
test_debug: ## run: only unit test (print debug mode)
@cargo test --lib -- --nocapture
.PHONY: format
format: ## run: cargo clippy && cargo fmt
@./scripts/cargo_format.sh
.PHONY: clean
clean: ## run: cargo clean
@cargo clean