2019-07-15 21:14:27 +02:00
|
|
|
# Look for a json keymap file
|
|
|
|
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","")
|
|
|
|
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","")
|
|
|
|
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","")
|
|
|
|
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","")
|
|
|
|
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
|
|
|
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Generate the keymap.c
|
|
|
|
ifneq ("$(KEYMAP_JSON)","")
|
2019-09-22 22:25:33 +02:00
|
|
|
_ = $(shell test -e $(KEYMAP_C) || bin/qmk json-keymap $(KEYMAP_JSON) -o $(KEYMAP_C))
|
2019-07-15 21:14:27 +02:00
|
|
|
endif
|