-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathMakefile
100 lines (85 loc) · 3.43 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.PHONY: git-submodule, qmk-clean, qmk-init, qmk-compile, qmk-flash, qmk-init-all, qmk-compile-all, vial-qmk-clean, vial-qmk-init, vial-qmk-compile, vial-qmk-flash, vial-qmk-init-all, vial-qmk-compile-all, update-all
KB := crkbd
KR := rev1
KM := default
git-submodule:
git submodule update --remote
git submodule update --init --recursive
qmk-clean:
rm -rf src/qmk/qmk_firmware/keyboards/tmp
cd src/qmk/qmk_firmware; qmk clean
qmk-init:
$(eval KB := ${kb})
rm -f src/qmk/qmk_firmware/keyboards/tmp/${KB}
mkdir -p src/qmk/qmk_firmware/keyboards/tmp
ln -s $(shell pwd)/keyboards/${KB}/qmk/qmk_firmware src/qmk/qmk_firmware/keyboards/tmp/${KB}
mkdir -p keyboards/${KB}/qmk/qmk_firmware/.build
qmk-compile:
$(eval KB := ${kb})
$(eval KR := ${kr})
$(eval KM := ${km})
$(eval FILE := $(shell echo "${kb}_${kr}_${km}" | sed 's/\//_/'))
cd src/qmk/qmk_firmware; qmk compile -kb tmp/${KB}/${KR} -km ${KM}
cp src/qmk/qmk_firmware/.build/tmp_${FILE}.hex keyboards/${KB}/qmk/qmk_firmware/.build/${FILE}.hex | true
cp src/qmk/qmk_firmware/.build/tmp_${FILE}.uf2 keyboards/${KB}/qmk/qmk_firmware/.build/${FILE}.uf2 | true
qmk-flash:
$(eval KB := ${kb})
$(eval KR := ${kr})
$(eval KM := ${km})
cd src/qmk/qmk_firmware; qmk flash -kb tmp/${KB}/${KR} -km ${KM}
qmk-init-all:
kb=crkbd make qmk-init
kb=cornelius make qmk-init
kb=lskbd make qmk-init
qmk-compile-all:
kb=crkbd kr=rev1 km=via make qmk-compile
kb=crkbd kr=rev4_0/standard km=via make qmk-compile
kb=crkbd kr=rev4_0/mini km=via make qmk-compile
kb=crkbd kr=rev4_1/standard km=via make qmk-compile
kb=crkbd kr=rev4_1/mini km=via make qmk-compile
kb=cornelius kr=rev1 km=via make qmk-compile
kb=cornelius kr=rev2 km=via make qmk-compile
kb=lskbd kr=rev1 km=via make qmk-compile
vial-qmk-clean:
rm -rf src/vial-kb/vial-qmk/keyboards/tmp
cd src/vial-kb/vial-qmk; qmk clean
vial-qmk-init:
$(eval KB := ${kb})
rm -rf src/vial-kb/vial-qmk/keyboards/tmp/${KB}
mkdir -p src/vial-kb/vial-qmk/keyboards/tmp/${KB}
cp -r $(shell pwd)/keyboards/${KB}/qmk/qmk_firmware/* src/vial-kb/vial-qmk/keyboards/tmp/${KB}
rm -rf src/vial-kb/vial-qmk/keyboards/tmp/${KB}/keymaps
ln -s $(shell pwd)/keyboards/${KB}/vial-kb/vial-qmk/keymaps src/vial-kb/vial-qmk/keyboards/tmp/${KB}/keymaps
mkdir -p keyboards/${KB}/vial-kb/vial-qmk/.build
vial-qmk-compile:
$(eval KB := ${kb})
$(eval KR := ${kr})
$(eval KM := ${km})
$(eval FILE := $(shell echo "${kb}_${kr}_${km}" | sed 's/\//_/'))
cd src/vial-kb/vial-qmk; qmk compile -kb tmp/${KB}/${KR} -km ${KM}
cp src/vial-kb/vial-qmk/.build/tmp_${FILE}.hex keyboards/${KB}/vial-kb/vial-qmk/.build/${FILE}.hex | true
cp src/vial-kb/vial-qmk/.build/tmp_${FILE}.uf2 keyboards/${KB}/vial-kb/vial-qmk/.build/${FILE}.uf2 | true
vial-qmk-flash:
$(eval KB := ${kb})
$(eval KR := ${kr})
$(eval KM := ${km})
cd src/vial-kb/vial-qmk; qmk flash -kb tmp/${KB}/${KR} -km ${KM}
vial-qmk-init-all:
kb=crkbd make vial-qmk-init
kb=cornelius make vial-qmk-init
kb=lskbd make vial-qmk-init
vial-qmk-compile-all:
kb=crkbd kr=rev4_0/standard km=vial make vial-qmk-compile
kb=crkbd kr=rev4_0/mini km=vial_mini make vial-qmk-compile
kb=crkbd kr=rev4_1/standard km=vial make vial-qmk-compile
kb=crkbd kr=rev4_1/mini km=vial_mini make vial-qmk-compile
kb=cornelius kr=rev2 km=vial make vial-qmk-compile
kb=lskbd kr=rev1 km=vial make vial-qmk-compile
update-all:
make git-submodule
make qmk-clean
make qmk-init-all
make qmk-compile-all
make vial-qmk-clean
make vial-qmk-init-all
make vial-qmk-compile-all