2019-07-15 21:14:27 +02:00
|
|
|
# Look for a json keymap file
|
|
|
|
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","")
|
2021-06-20 00:30:23 +02:00
|
|
|
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
2019-07-15 21:14:27 +02:00
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","")
|
2021-06-20 00:30:23 +02:00
|
|
|
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
2019-07-15 21:14:27 +02:00
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","")
|
2021-06-20 00:30:23 +02:00
|
|
|
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
2019-07-15 21:14:27 +02:00
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","")
|
2021-06-20 00:30:23 +02:00
|
|
|
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
2019-07-15 21:14:27 +02:00
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
|
|
|
|
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
2021-06-20 00:30:23 +02:00
|
|
|
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
2019-07-15 21:14:27 +02:00
|
|
|
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
|
|
|
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
|
|
|
endif
|
|
|
|
|
2020-04-18 15:29:48 +02:00
|
|
|
# Load the keymap-level rules.mk if exists
|
|
|
|
ifneq ("$(wildcard $(KEYMAP_PATH))", "")
|
|
|
|
-include $(KEYMAP_PATH)/rules.mk
|
|
|
|
endif
|
|
|
|
|
2019-07-15 21:14:27 +02:00
|
|
|
# Generate the keymap.c
|
2021-06-20 00:30:23 +02:00
|
|
|
$(KEYMAP_C): $(KEYMAP_JSON)
|
2021-03-08 04:10:03 +01:00
|
|
|
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|