aboutsummaryrefslogtreecommitdiff
path: root/build_keyboard.mk
diff options
context:
space:
mode:
Diffstat (limited to 'build_keyboard.mk')
-rw-r--r--build_keyboard.mk33
1 files changed, 31 insertions, 2 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index 8d018f2e3..816681bd0 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -90,13 +90,16 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
90 include $(KEYBOARD_PATH_1)/rules.mk 90 include $(KEYBOARD_PATH_1)/rules.mk
91endif 91endif
92 92
93
94MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP) 93MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
95MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP) 94MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
96MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP) 95MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
97MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP) 96MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
98MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP) 97MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
99 98
99# Pull in rules from info.json
100INFO_RULES_MK = $(shell bin/qmk generate-rules-mk --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
101include $(INFO_RULES_MK)
102
100# Check for keymap.json first, so we can regenerate keymap.c 103# Check for keymap.json first, so we can regenerate keymap.c
101include build_json.mk 104include build_json.mk
102 105
@@ -290,6 +293,32 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
290 CONFIG_H += $(KEYMAP_PATH)/config.h 293 CONFIG_H += $(KEYMAP_PATH)/config.h
291endif 294endif
292 295
296# Pull in stuff from info.json
297INFO_JSON_FILES :=
298ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
299 INFO_JSON_FILES += $(KEYBOARD_PATH_1)/info.json
300endif
301ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","")
302 INFO_JSON_FILES += $(KEYBOARD_PATH_2)/info.json
303endif
304ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","")
305 INFO_JSON_FILES += $(KEYBOARD_PATH_3)/info.json
306endif
307ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","")
308 INFO_JSON_FILES += $(KEYBOARD_PATH_4)/info.json
309endif
310ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
311 INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
312endif
313
314CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
315
316$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
317 bin/qmk generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h
318
319$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
320 bin/qmk generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h
321
293# project specific files 322# project specific files
294SRC += $(KEYBOARD_SRC) \ 323SRC += $(KEYBOARD_SRC) \
295 $(KEYMAP_C) \ 324 $(KEYMAP_C) \
@@ -364,7 +393,7 @@ all:
364 echo "skipped" >&2 393 echo "skipped" >&2
365endif 394endif
366 395
367build: elf cpfirmware 396build: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h elf cpfirmware
368check-size: build 397check-size: build
369objs-size: build 398objs-size: build
370 399