-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (63 loc) · 2.76 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
76
77
78
.PHONY: clean all
.PHONY: corne corne_left corne_right
.PHONY: ferris cradio_left cradio_right
.PHONY: weejock
.PHONY: zaphod zaphod_lite
.PHONY: deploy_corne deploy_ferris deploy_weejock deploy_zaphod
MAKEFLAGS += --jobs=2
APP_DIR := $(realpath ../zmk/app)
BUILD_DIR := ${APP_DIR}/build
ZMK_CONFIG_DIR := $(realpath ../zmk-config)
ZMK_HELPERS_DIR := $(realpath ../zmk-helpers)
ZMK_AUTO_LAYER_DIR := $(realpath ../zmk-auto-layer)
ZAPHOD_CONFIG_DIR := $(realpath ../zaphod-config)
WEEJOCK_CONFIG_DIR := $(realpath ../weejock-zmk)
EXTRA_MODULES := ${ZMK_HELPERS_DIR}
# Shenanigans for joining words with subst later.
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
XIAO_PATH := /media/${USER}/XIAO-SENSE
NANO_PATH := /media/${USER}/NICENANO
# Uncomment WESTFLAGS and CMAKEFLAGS if using ZMK Studio.
#WESTFLAGS := -S studio-rpc-usb-uart
#CMAKEFLAGS := -DCONFIG_ZMK_STUDIO=y
all: corne ferris zaphod
corne: corne_left corne_right
ls -l ${BUILD_DIR}/corne_*/zephyr/zmk.uf2
corne_left corne_right:
cd ${APP_DIR} && west build -d build/$@ -b nice_nano_v2 -- -DSHIELD=$@ ${CMAKEFLAGS} -DZMK_CONFIG=${ZMK_CONFIG_DIR}/config -DZMK_EXTRA_MODULES="$(subst $(SPACE),;,$(EXTRA_MODULES))"
deploy_corne: corne
@echo -n "Put corne_left in update mode..."
@until [ -d ${NANO_PATH} ]; do sleep 1s; done
@echo
cp -v ${BUILD_DIR}/corne_left/zephyr/zmk.uf2 ${NANO_PATH}/
@echo -n "Put corne_right in update mode..."
@until [ -d ${NANO_PATH} ]; do sleep 1s; done
@echo
cp -v ${BUILD_DIR}/corne_right/zephyr/zmk.uf2 ${NANO_PATH}/
ferris: cradio_left cradio_right
cradio_left cradio_right:
cd ${APP_DIR} && west build -d build/$@ -b nice_nano_v2 -- -DSHIELD=$@ -DZMK_CONFIG=${ZMK_CONFIG_DIR}/config -DZMK_EXTRA_MODULES="$(subst $(SPACE),;,$(EXTRA_MODULES))"
deploy_ferris: ferris
@echo -n "Put ferris_left in update mode..."
@until [ -d ${NANO_PATH} ]; do sleep 1s; done
@echo
cp -v ${BUILD_DIR}/cradio_left/zephyr/zmk.uf2 ${NANO_PATH}/
@echo -n "Put ferris_right in update mode..."
@until [ -d ${NANO_PATH} ]; do sleep 1s; done
@echo
cp -v ${BUILD_DIR}/cradio_right/zephyr/zmk.uf2 ${NANO_PATH}/
weejock: EXTRA_MODULES += ${WEEJOCK_CONFIG_DIR}
weejock:
cd ${APP_DIR} && west build -d build/$@ -b seeeduino_xiao_ble -- -DSHIELD=$@ -DZMK_CONFIG=${ZMK_CONFIG_DIR}/config -DZMK_EXTRA_MODULES="$(subst $(SPACE),;,$(EXTRA_MODULES))"
zaphod: zaphod_lite
zaphod_lite: EXTRA_MODULES += ${ZAPHOD_CONFIG_DIR} ${ZMK_AUTO_LAYER_DIR}
zaphod_lite:
cd ${APP_DIR} && west build -d build/$@ -b seeeduino_xiao_ble -- -DSHIELD=$@ -DZMK_CONFIG=${ZMK_CONFIG_DIR}/config -DZMK_EXTRA_MODULES="$(subst $(SPACE),;,$(EXTRA_MODULES))"
deploy_zaphod: zaphod_lite
@echo -n "Put zaphod_lite in update mode..."
@until [ -d ${XIAO_PATH} ]; do sleep 1s; done
@echo
cp -v ${BUILD_DIR}/zaphod_lite/zephyr/zmk.uf2 ${XIAO_PATH}/
clean:
rm -rf ${BUILD_DIR}