-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 1.14 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
PWD = $(shell pwd)
# zmk config
shield_l = leeloo_left
shield_r = leeloo_right
board = nice_nano_v2
# output files
file_l = build/${shield_l}_${board}.uf2
file_r = build/${shield_r}_${board}.uf2
# where to flash
device = /dev/disk/by-label/NICENANO
default:
@echo
@echo "Available targets:"
@grep -E '^[a-zA-Z_-].*?: .*?## .*$$' Makefile | sed 's#\\:#:#g' | awk 'BEGIN {FS = ": .*?## "}; {printf "\033[36m %-20s\033[0m %s\n", $$1, $$2}'
@echo
build: ${file_r} ## Build the firmware (right and left) [alias: b]
build-left: ${file_l} ## Build the firmware (left only) [alias: bl]
flash-left: ${file_l} ## Flash left [alias: l]
@sudo bash flash.sh --file ${file_l}
flash-right: ${file_r} ## Flash right [alias: r]
@sudo bash flash.sh --file ${file_r}
clean: ## Clean cache to rebuild from scratch
docker image rm zmkfirmware/zmk-build-arm:stable || true
sudo rm -rf .cache build/*.uf2
${file_l}: config/*
bash build.sh --board ${board} --left ${shield_l}
${file_r}: config/*
bash build.sh --board ${board} --left ${shield_l} --right ${shield_r}
b: build
l: flash-left
r: flash-right
bl: build-left
.PHONY: build b clean c flash-left l flash-right r