-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.28 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
# Get qmk path using the qmk cli
# qmk_home := ${HOME}/qmk_firmware
qmk_home := $(shell qmk config user.qmk_home | cut -d= -f2)
qmk_user := $(shell qmk config user.name | cut -d= -f2)
# Set `keyboard` to select keyboard base
keyboard := crkbd/rev1/common
keymap_name := mailmanpat
keyboard_path := $(shell echo ${keyboard} | cut -d "/" -f1)
# Set `use_docker=1` to use Docker for building
ifeq (${use_docker},1)
make := ./util/docker_build.sh
else
make := make
endif
debug:
@echo ${keyboard_path}:${keyboard}:${keymap_name}
help:
@echo "Try 'make c' (compile) or 'make f' (flash)"
ref:
@grep -E '[│─┄]' keymap.c | less
compile: push
cd ${qmk_home} && ${make} ${keyboard}:${keymap_name}
flash: push
cd ${qmk_home} && ${make} ${keyboard}:${keymap_name}:flash
${qmk_home}/keyboards/${keyboard_path}/keymaps/${keymap_name}/%: ./%
cp $< $@
mkdir:
@mkdir -p ${qmk_home}/keyboards/${keyboard_path}/keymaps/${keymap_name}
push: \
mkdir \
${qmk_home}/keyboards/${keyboard_path}/keymaps/${keymap_name}/config.h \
${qmk_home}/keyboards/${keyboard_path}/keymaps/${keymap_name}/rules.mk \
${qmk_home}/keyboards/${keyboard_path}/keymaps/${keymap_name}/keymap.c
# Don't delete these intermediate files
.PRECIOUS: %/keymap.c
.DEFAULT_GOAL := compile
c: compile
f: flash
r: ref