-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (31 loc) · 1.03 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
## TARGETS
.PHONY: all
all: ## Compile, default target for Vim
all: compile_commands.json compile
.PHONY: compile
compile: ## Compile firmware.
compile: include/version.h
pio run
.PHONY: clean
clean: ## Clean project.
pio run --target clean
.PHONY: upload
upload: ## Upload firmware via local programmer.
pio run --target upload
.PHONY: check
check: ## Run static code analysis
pio check
.PHONY: test
test: ## Run native tests.
pio test -e native
compile_commands.json: platformio.ini
pio run --target compiledb
# This needs to be regenerated on every run to be able to
# detect -dirty state.
.PHONY: include/version.h
include/version.h:
echo "#define ELECTRICITY_METER_VERSION \"$(shell git describe --dirty --always --tags)\"" > include/version.h
echo "#define ELECTRICITY_METER_BUILD_TIME \"$(shell date --utc +"%Y%m%dT%H%M%SZ")\"" >> include/version.h
.PHONY: help
help: ## Show this help.
@grep -F -h "##" $(MAKEFILE_LIST) | sed -e '/unique_BhwaDzu7C/d;s/\\$$//;s/##//'