-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (26 loc) · 867 Bytes
/
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
BIN := ruuvi2mqtt
ARCHS := aarch64 armv7 x86_64
TARGET_ARCH_aarch64 = aarch64-unknown-linux-gnu
TARGET_ARCH_x86_64 = x86_64-unknown-linux-gnu
TARGET_ARCH_armv7 = armv7-unknown-linux-gnueabihf
.DEFAULT_GOAL := help
.PHONY: help
help: ## Display this help
@grep -hE '^[a-zA-Z-][a-zA-Z0-9_\.-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all
all: local $(ARCHS) ## Lint and build all architectures
.PHONY: local
local: test ## Test and build locally
cargo build
.PHONY: test
test: lint ## Lint and test
cargo test
.PHONY: lint
lint: ## Format and lint
cargo fmt --all
cargo clippy --all --all-features
.PHONY: cross
cross: $(ARCHS) ## Build all non-local architectures
.PHONY: $(ARCHS)
$(ARCHS): ## Build for the specified architecture
cross build --target $(TARGET_ARCH_$@)