aboutsummaryrefslogtreecommitdiff
path: root/build_keyboard.mk
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-10-16 11:14:52 -0700
committerJack Humbert <jack.humb@gmail.com>2018-10-16 14:14:52 -0400
commit6cf9402cbc8156dd7c0892822ba949a1a1d8a4ba (patch)
treeb9f546ac13dac709520a0f168d9d74144e19a7bc /build_keyboard.mk
parent76aa2baf3ea169b976c4cef7013b2020d93a69c3 (diff)
downloadqmk_firmware-6cf9402cbc8156dd7c0892822ba949a1a1d8a4ba.tar.gz
qmk_firmware-6cf9402cbc8156dd7c0892822ba949a1a1d8a4ba.zip
Fix LAYOUT define generation (#4148)
* Fix LAYOUT define generation Prior to this, only the full keyboard path was defined. Eg `KEYBOARD_planck_rev6`. But the docs mention `KEYBOAD_planck`, which never actually gets defined. This addresses this, and creates a define for each level of the keyboard folder, so that stuff like `KEYBOARD_planck` actually exists. * Clean up changes to make it more readable
Diffstat (limited to 'build_keyboard.mk')
-rw-r--r--build_keyboard.mk22
1 files changed, 21 insertions, 1 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index a73741bb3..d225fe821 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","")
110 KEYBOARD_SRC += $(KEYBOARD_C_1) 110 KEYBOARD_SRC += $(KEYBOARD_C_1)
111endif 111endif
112 112
113OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE) 113# Generate KEYBOARD_name_subname for all levels of the keyboard folder
114KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
115KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
116KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
117KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
118KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
114 119
120ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
121 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
122endif
123ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
124 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
125endif
126ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
127 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
128endif
129ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
130 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
131endif
132ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
133 OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
134endif
115 135
116# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so 136# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
117# that the same keymap may be used on multiple keyboards. 137# that the same keymap may be used on multiple keyboards.