Skip to content

Commit

Permalink
Eliminate TMK_COMMON_* in makefiles (qmk#21517)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and csolje committed Oct 21, 2023
1 parent 5f78bb5 commit 906270b
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 116 deletions.
3 changes: 1 addition & 2 deletions builddefs/build_full_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions builddefs/build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 0 additions & 26 deletions keyboards/capsunlocked/cu75/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"
26 changes: 0 additions & 26 deletions keyboards/capsunlocked/cu75/keymaps/iso/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"
23 changes: 23 additions & 0 deletions keyboards/capsunlocked/cu75/post_rules.mk
Original file line number Diff line number Diff line change
@@ -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)\"
6 changes: 3 additions & 3 deletions keyboards/lfkeyboards/lfk78/post_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions keyboards/lfkeyboards/lfkpad/post_rules.mk
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions keyboards/lfkeyboards/mini1800/reva/post_rules.mk
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions keyboards/lfkeyboards/mini1800/revc/post_rules.mk
Original file line number Diff line number Diff line change
@@ -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
9 changes: 0 additions & 9 deletions keyboards/lfkeyboards/smk65/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 0 additions & 9 deletions keyboards/lfkeyboards/smk65/keymaps/iso/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions keyboards/lfkeyboards/smk65/post_rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ifeq ($(strip $(ISSI_ENABLE)), yes)
OPT_DEFS += -DISSI_ENABLE
endif

ifeq ($(strip $(WATCHDOG_ENABLE)), yes)
OPT_DEFS += -DWATCHDOG_ENABLE
endif
9 changes: 9 additions & 0 deletions keyboards/woodkeys/meira/post_rules.mk
Original file line number Diff line number Diff line change
@@ -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
9 changes: 0 additions & 9 deletions keyboards/woodkeys/meira/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions platforms/avr/printf.mk
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion platforms/common.mk
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
40 changes: 20 additions & 20 deletions tmk_core/protocol.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TMK_COMMON_SRC += \
SRC += \
$(PROTOCOL_DIR)/host.c \
$(PROTOCOL_DIR)/report.c \
$(PROTOCOL_DIR)/usb_device_state.c \
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 906270b

Please sign in to comment.