-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 1005 Bytes
/
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
USER = trekdemo
KEYBOARDS = atreus skeletyl dilemma
# Keybard mapping
PATH_atreus = keyboardio/atreus
MAKE_atreus = keyboardio/atreus
PATH_skeletyl = bastardkb/skeletyl
MAKE_skeletyl = bastardkb/skeletyl/v1/elitec
PATH_dilemma = bastardkb/dilemma
MAKE_dilemma = bastardkb/dilemma
all: $(KEYBOARDS)
CMD = "compile"
.PHONY: $(KEYBOARDS)
$(KEYBOARDS):
# Remove old keymaps
rm -rf qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER)
rm -rf qmk_firmware/users/$(USER)
# Init submodule
git submodule update --init --recursive
# Create symlinks
ln -s $(shell pwd)/user qmk_firmware/users/$(USER)
ln -s $(shell pwd)/$@ qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER)
# Run lint and compile/flash/...
cd qmk_firmware; \
qmk lint --strict --keymap $(USER) --keyboard $(MAKE_$@) && \
qmk $(CMD) --parallel 1 --keymap $(USER) --keyboard $(MAKE_$@)
# Cleanup symlinks
rm -rf qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER)
rm -rf qmk_firmware/users/$(USER)
clean:
rm -rf $(shell pwd)/build