diff options
-rw-r--r-- | build_keyboard.mk | 22 |
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) |
111 | endif | 111 | endif |
112 | 112 | ||
113 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE) | 113 | # Generate KEYBOARD_name_subname for all levels of the keyboard folder |
114 | KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1))) | ||
115 | KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2))) | ||
116 | KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3))) | ||
117 | KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4))) | ||
118 | KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5))) | ||
114 | 119 | ||
120 | ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","") | ||
121 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5) | ||
122 | endif | ||
123 | ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","") | ||
124 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4) | ||
125 | endif | ||
126 | ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","") | ||
127 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3) | ||
128 | endif | ||
129 | ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","") | ||
130 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2) | ||
131 | endif | ||
132 | ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","") | ||
133 | OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1) | ||
134 | endif | ||
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. |