diff --git a/build_keyboard.mk b/build_keyboard.mk index 4108704875d2..30588f0a493c 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -290,6 +290,9 @@ ifneq ("$(wildcard $(USER_PATH)/config.h)","") CONFIG_H += $(USER_PATH)/config.h endif +# Disable features that a keyboard doesn't support +-include disable_features.mk + # Object files directory # To put object files in current directory, use a dot (.), do NOT make # this an empty or blank macro! diff --git a/disable_features.mk b/disable_features.mk new file mode 100644 index 000000000000..38bf61705166 --- /dev/null +++ b/disable_features.mk @@ -0,0 +1,89 @@ +# Unconditionally disable features that a keyboard advertises it doesn't support + +ifeq ($(strip $(ADAFRUIT_BLE_SUPPORTED)), no) + ADAFRUIT_BLE_ENABLE=no +endif + +ifeq ($(strip $(AUDIO_SUPPORTED)), no) + AUDIO_ENABLE=no +endif + +ifeq ($(strip $(BACKLIGHT_SUPPORTED)), no) + BACKLIGHT_ENABLE=no +endif + +ifeq ($(strip $(BLUETOOTH_SUPPORTED)), no) + BLUETOOTH_ENABLE=no +endif + +ifeq ($(strip $(DIP_SWITCH_SUPPORTED)), no) + DIP_SWITCH_ENABLE=no +endif + +ifeq ($(strip $(DYNAMIC_KEYMAP_SUPPORTED)), no) + DYNAMIC_KEYMAP_ENABLE=no +endif + +ifeq ($(strip $(ENCODER_SUPPORTED)), no) + ENCODER_ENABLE=no +endif + +ifeq ($(strip $(HAPTIC_SUPPORTED)), no) + HAPTIC_ENABLE=no +endif + +ifeq ($(strip $(HD44780_SUPPORTED)), no) + HD44780_ENABLE=no +endif + +ifeq ($(strip $(IOS_DEVICE_SUPPORTED)), no) + IOS_DEVICE_ENABLE=no +endif + +ifeq ($(strip $(LCD_BACKLIGHT_SUPPORTED)), no) + LCD_BACKLIGHT_ENABLE=no +endif + +ifeq ($(strip $(LCD_SUPPORTED)), no) + LCD_ENABLE=no +endif + +ifeq ($(strip $(OLED_SUPPORTED)), no) + OLED_ENABLE=no +endif + +ifeq ($(strip $(PRINTING_SUPPORTED)), no) + PRINTING_ENABLE=no +endif + +ifeq ($(strip $(PS2_MOUSE_SUPPORTED)), no) + PS2_MOUSE_ENABLE=no +endif + +ifeq ($(strip $(RGBLIGHT_SUPPORTED)), no) + RGBLIGHT_ENABLE=no +endif + +ifeq ($(strip $(RGB_MATRIX_SUPPORTED)), no) + RGB_MATRIX_ENABLE=no +endif + +ifeq ($(strip $(STENO_SUPPORTED)), no) + STENO_ENABLE=no +endif + +ifeq ($(strip $(SWAP_HANDS_SUPPORTED)), no) + SWAP_HANDS_ENABLE=no +endif + +ifeq ($(strip $(VISUALIZER_SUPPORTED)), no) + VISUALIZER_ENABLE=no +endif + +ifeq ($(strip $(WATCHDOG_SUPPORTED)), no) + WATCHDOG_ENABLE=no +endif + +ifeq ($(strip $(XT_SUPPORTED)), no) + XT_ENABLE=no +endif