2019-07-16 01:14:27 +06: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
|
|
|
|
|
2020-04-18 19:29:48 +06:00
|
|
|
# Load the keymap-level rules.mk if exists
|
|
|
|
ifneq ("$(wildcard $(KEYMAP_PATH))", "")
|
|
|
|
-include $(KEYMAP_PATH)/rules.mk
|
|
|
|
endif
|
|
|
|
|
2019-07-16 01:14:27 +06:00
|
|
|
# Generate the keymap.c
|
2019-12-09 01:00:26 +06:00
|
|
|
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
2020-03-11 02:51:19 +06:00
|
|
|
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|