From b9e5895184c6d36b46ba723d6d71e27249e70c20 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 15 Jul 2023 17:27:32 +1000 Subject: [PATCH] Eliminate `TMK_COMMON_*` in makefiles (#21517) --- builddefs/build_full_test.mk | 3 +- builddefs/build_keyboard.mk | 3 -- .../cu75/keymaps/default/rules.mk | 26 ------------ .../capsunlocked/cu75/keymaps/iso/rules.mk | 26 ------------ keyboards/capsunlocked/cu75/post_rules.mk | 23 +++++++++++ keyboards/lfkeyboards/lfk78/post_rules.mk | 6 +-- keyboards/lfkeyboards/lfkpad/post_rules.mk | 4 +- .../lfkeyboards/mini1800/reva/post_rules.mk | 4 +- .../lfkeyboards/mini1800/revc/post_rules.mk | 4 +- .../smk65/keymaps/default/rules.mk | 9 ----- .../lfkeyboards/smk65/keymaps/iso/rules.mk | 9 ----- keyboards/lfkeyboards/smk65/post_rules.mk | 7 ++++ keyboards/woodkeys/meira/post_rules.mk | 9 +++++ keyboards/woodkeys/meira/rules.mk | 9 ----- platforms/avr/printf.mk | 4 +- platforms/common.mk | 2 +- tmk_core/protocol.mk | 40 +++++++++---------- 17 files changed, 72 insertions(+), 116 deletions(-) create mode 100644 keyboards/capsunlocked/cu75/post_rules.mk create mode 100644 keyboards/lfkeyboards/smk65/post_rules.mk create mode 100644 keyboards/woodkeys/meira/post_rules.mk diff --git a/builddefs/build_full_test.mk b/builddefs/build_full_test.mk index 964ba773d48..85ee0898ec2 100644 --- a/builddefs/build_full_test.mk +++ b/builddefs/build_full_test.mk @@ -17,7 +17,6 @@ $(TEST)_INC := \ tests/test_common/common_config.h $(TEST)_SRC := \ - $(TMK_COMMON_SRC) \ $(QUANTUM_SRC) \ $(SRC) \ $(QUANTUM_PATH)/keymap_introspection.c \ @@ -31,7 +30,7 @@ $(TEST)_SRC := \ tests/test_common/test_logger.cpp \ $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp)) -$(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\"" +$(TEST)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\"" $(TEST)_CONFIG := $(TEST_PATH)/config.h diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk index 72c990abbba..e93ab97cc13 100644 --- a/builddefs/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -431,9 +431,6 @@ include $(PLATFORM_PATH)/common.mk SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) -SRC += $(TMK_COMMON_SRC) -OPT_DEFS += $(TMK_COMMON_DEFS) -EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) -include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk diff --git a/keyboards/capsunlocked/cu75/keymaps/default/rules.mk b/keyboards/capsunlocked/cu75/keymaps/default/rules.mk index bbd4c8c9fdc..aefb10a8b11 100644 --- a/keyboards/capsunlocked/cu75/keymaps/default/rules.mk +++ b/keyboards/capsunlocked/cu75/keymaps/default/rules.mk @@ -12,29 +12,3 @@ SLEEP_LED_ENABLE = yes ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms - - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - -# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired -# # -# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight -# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB -# # -# # Set to B, C or D -# LFK_REV = D - -# ifeq ($(LFK_REV), B) -# MCU = atmega32u4 -# else -# MCU = at90usb1286 -# endif -# OPT_DEFS += -DLFK_REV_$(LFK_REV) -# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/capsunlocked/cu75/keymaps/iso/rules.mk b/keyboards/capsunlocked/cu75/keymaps/iso/rules.mk index be27fed69c1..26239f265ee 100644 --- a/keyboards/capsunlocked/cu75/keymaps/iso/rules.mk +++ b/keyboards/capsunlocked/cu75/keymaps/iso/rules.mk @@ -12,29 +12,3 @@ SLEEP_LED_ENABLE = yes ISSI_ENABLE = no # If the I2C pullup resistors aren't install this must be disabled WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms - - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - -# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired -# # -# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight -# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB -# # -# # Set to B, C or D -# LFK_REV = D - -# ifeq ($(LFK_REV), B) -# MCU = atmega32u4 -# else -# MCU = at90usb1286 -# endif -# OPT_DEFS += -DLFK_REV_$(LFK_REV) -# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/capsunlocked/cu75/post_rules.mk b/keyboards/capsunlocked/cu75/post_rules.mk new file mode 100644 index 00000000000..a5d97466643 --- /dev/null +++ b/keyboards/capsunlocked/cu75/post_rules.mk @@ -0,0 +1,23 @@ +ifeq ($(strip $(ISSI_ENABLE)), yes) + OPT_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + OPT_DEFS += -DWATCHDOG_ENABLE +endif + +# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired +# # +# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight +# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB +# # +# # Set to B, C or D +# LFK_REV = D + +# ifeq ($(LFK_REV), B) +# MCU = atmega32u4 +# else +# MCU = at90usb1286 +# endif +# OPT_DEFS += -DLFK_REV_$(LFK_REV) +# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/lfkeyboards/lfk78/post_rules.mk b/keyboards/lfkeyboards/lfk78/post_rules.mk index 03f975b9df2..817a085f5e2 100644 --- a/keyboards/lfkeyboards/lfk78/post_rules.mk +++ b/keyboards/lfkeyboards/lfk78/post_rules.mk @@ -2,13 +2,13 @@ SRC += TWIlib.c issi.c lighting.c ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE + OPT_DEFS += -DISSI_ENABLE endif ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE + OPT_DEFS += -DWATCHDOG_ENABLE endif ifeq ($(strip $(CAPSLOCK_LED)), yes) - TMK_COMMON_DEFS += -DCAPSLOCK_LED + OPT_DEFS += -DCAPSLOCK_LED endif diff --git a/keyboards/lfkeyboards/lfkpad/post_rules.mk b/keyboards/lfkeyboards/lfkpad/post_rules.mk index ad997587b2d..044d9754f15 100644 --- a/keyboards/lfkeyboards/lfkpad/post_rules.mk +++ b/keyboards/lfkeyboards/lfkpad/post_rules.mk @@ -1,7 +1,7 @@ ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE + OPT_DEFS += -DISSI_ENABLE endif ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE + OPT_DEFS += -DWATCHDOG_ENABLE endif diff --git a/keyboards/lfkeyboards/mini1800/reva/post_rules.mk b/keyboards/lfkeyboards/mini1800/reva/post_rules.mk index ad997587b2d..044d9754f15 100644 --- a/keyboards/lfkeyboards/mini1800/reva/post_rules.mk +++ b/keyboards/lfkeyboards/mini1800/reva/post_rules.mk @@ -1,7 +1,7 @@ ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE + OPT_DEFS += -DISSI_ENABLE endif ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE + OPT_DEFS += -DWATCHDOG_ENABLE endif diff --git a/keyboards/lfkeyboards/mini1800/revc/post_rules.mk b/keyboards/lfkeyboards/mini1800/revc/post_rules.mk index ad997587b2d..044d9754f15 100644 --- a/keyboards/lfkeyboards/mini1800/revc/post_rules.mk +++ b/keyboards/lfkeyboards/mini1800/revc/post_rules.mk @@ -1,7 +1,7 @@ ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE + OPT_DEFS += -DISSI_ENABLE endif ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE + OPT_DEFS += -DWATCHDOG_ENABLE endif diff --git a/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk b/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk index 0cc9a7b76ba..1f0147bd38f 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/smk65/keymaps/default/rules.mk @@ -6,12 +6,3 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow ISSI_ENABLE = no # If the I2C pullup resistors aren't install this must be disabled WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms - - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif diff --git a/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk b/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk index 0cc9a7b76ba..1f0147bd38f 100644 --- a/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk @@ -6,12 +6,3 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow ISSI_ENABLE = no # If the I2C pullup resistors aren't install this must be disabled WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms - - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif diff --git a/keyboards/lfkeyboards/smk65/post_rules.mk b/keyboards/lfkeyboards/smk65/post_rules.mk new file mode 100644 index 00000000000..044d9754f15 --- /dev/null +++ b/keyboards/lfkeyboards/smk65/post_rules.mk @@ -0,0 +1,7 @@ +ifeq ($(strip $(ISSI_ENABLE)), yes) + OPT_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + OPT_DEFS += -DWATCHDOG_ENABLE +endif diff --git a/keyboards/woodkeys/meira/post_rules.mk b/keyboards/woodkeys/meira/post_rules.mk new file mode 100644 index 00000000000..5d85581c6ee --- /dev/null +++ b/keyboards/woodkeys/meira/post_rules.mk @@ -0,0 +1,9 @@ +SRC += matrix.c TWIlib.c issi.c lighting.c + +#ifeq ($(strip $(ISSI_ENABLE)), yes) +# OPT_DEFS += -DISSI_ENABLE +#endif + +#ifeq ($(strip $(WATCHDOG_ENABLE)), yes) +# OPT_DEFS += -DWATCHDOG_ENABLE +#endif diff --git a/keyboards/woodkeys/meira/rules.mk b/keyboards/woodkeys/meira/rules.mk index 20802b31790..63586244c0e 100644 --- a/keyboards/woodkeys/meira/rules.mk +++ b/keyboards/woodkeys/meira/rules.mk @@ -14,13 +14,4 @@ AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = yes -#ifeq ($(strip $(ISSI_ENABLE)), yes) -# TMK_COMMON_DEFS += -DISSI_ENABLE -#endif - -#ifeq ($(strip $(WATCHDOG_ENABLE)), yes) -# TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -#endif -SRC += matrix.c TWIlib.c issi.c lighting.c - DEFAULT_FOLDER = woodkeys/meira/promicro diff --git a/platforms/avr/printf.mk b/platforms/avr/printf.mk index 060ad88c57c..c6490169d83 100644 --- a/platforms/avr/printf.mk +++ b/platforms/avr/printf.mk @@ -1,2 +1,2 @@ -TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S -TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c +SRC += $(PLATFORM_COMMON_DIR)/xprintf.S +SRC += $(PLATFORM_COMMON_DIR)/printf.c diff --git a/platforms/common.mk b/platforms/common.mk index da0697e3b09..bbbe71ea126 100644 --- a/platforms/common.mk +++ b/platforms/common.mk @@ -1,6 +1,6 @@ PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY) -TMK_COMMON_SRC += \ +SRC += \ $(PLATFORM_PATH)/suspend.c \ $(PLATFORM_PATH)/synchronization_util.c \ $(PLATFORM_PATH)/timer.c \ diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 2ae7aa9abea..d159dacc55b 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -1,4 +1,4 @@ -TMK_COMMON_SRC += \ +SRC += \ $(PROTOCOL_DIR)/host.c \ $(PROTOCOL_DIR)/report.c \ $(PROTOCOL_DIR)/usb_device_state.c \ @@ -7,7 +7,7 @@ TMK_COMMON_SRC += \ SHARED_EP_ENABLE = no MOUSE_SHARED_EP ?= yes ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP + OPT_DEFS += -DKEYBOARD_SHARED_EP SHARED_EP_ENABLE = yes # With the current usb_descriptor.c code, # you can't share kbd without sharing mouse; @@ -18,31 +18,31 @@ endif ifeq ($(strip $(MOUSE_ENABLE)), yes) OPT_DEFS += -DMOUSE_ENABLE ifeq ($(strip $(MOUSE_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DMOUSE_SHARED_EP + OPT_DEFS += -DMOUSE_SHARED_EP SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) - TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE + OPT_DEFS += -DEXTRAKEY_ENABLE SHARED_EP_ENABLE = yes endif ifeq ($(strip $(PROGRAMMABLE_BUTTON_ENABLE)), yes) - TMK_COMMON_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE + OPT_DEFS += -DPROGRAMMABLE_BUTTON_ENABLE SHARED_EP_ENABLE = yes endif ifeq ($(strip $(RAW_ENABLE)), yes) - TMK_COMMON_DEFS += -DRAW_ENABLE + OPT_DEFS += -DRAW_ENABLE endif ifeq ($(strip $(CONSOLE_ENABLE)), yes) - TMK_COMMON_DEFS += -DCONSOLE_ENABLE + OPT_DEFS += -DCONSOLE_ENABLE else # TODO: decouple this so other print backends can exist - TMK_COMMON_DEFS += -DNO_PRINT - TMK_COMMON_DEFS += -DNO_DEBUG + OPT_DEFS += -DNO_PRINT + OPT_DEFS += -DNO_DEBUG endif ifeq ($(strip $(NKRO_ENABLE)), yes) @@ -51,51 +51,51 @@ ifeq ($(strip $(NKRO_ENABLE)), yes) else ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) $(info NKRO is not currently supported with Bluetooth, and has been disabled.) else - TMK_COMMON_DEFS += -DNKRO_ENABLE + OPT_DEFS += -DNKRO_ENABLE SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(RING_BUFFERED_6KRO_REPORT_ENABLE)), yes) - TMK_COMMON_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE + OPT_DEFS += -DRING_BUFFERED_6KRO_REPORT_ENABLE endif ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes) - TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN + OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes) - TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK + OPT_DEFS += -DNO_USB_STARTUP_CHECK endif ifeq ($(strip $(JOYSTICK_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DJOYSTICK_SHARED_EP + OPT_DEFS += -DJOYSTICK_SHARED_EP SHARED_EP_ENABLE = yes endif ifeq ($(strip $(JOYSTICK_ENABLE)), yes) - TMK_COMMON_DEFS += -DJOYSTICK_ENABLE + OPT_DEFS += -DJOYSTICK_ENABLE ifeq ($(strip $(SHARED_EP_ENABLE)), yes) - TMK_COMMON_DEFS += -DJOYSTICK_SHARED_EP + OPT_DEFS += -DJOYSTICK_SHARED_EP SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(DIGITIZER_SHARED_EP)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP + OPT_DEFS += -DDIGITIZER_SHARED_EP SHARED_EP_ENABLE = yes endif ifeq ($(strip $(DIGITIZER_ENABLE)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_ENABLE + OPT_DEFS += -DDIGITIZER_ENABLE ifeq ($(strip $(SHARED_EP_ENABLE)), yes) - TMK_COMMON_DEFS += -DDIGITIZER_SHARED_EP + OPT_DEFS += -DDIGITIZER_SHARED_EP SHARED_EP_ENABLE = yes endif endif ifeq ($(strip $(SHARED_EP_ENABLE)), yes) - TMK_COMMON_DEFS += -DSHARED_EP_ENABLE + OPT_DEFS += -DSHARED_EP_ENABLE endif ifeq ($(strip $(USB_HID_ENABLE)), yes)