3 PLATFORM_COMMON_DIR = $(COMMON_DIR)/avr
4 else ifeq ($(PLATFORM),CHIBIOS)
5 PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios
7 PLATFORM_COMMON_DIR = $(COMMON_DIR)/native
10 TMK_COMMON_SRC += $(COMMON_DIR)/host.c \
11 $(COMMON_DIR)/keyboard.c \
12 $(COMMON_DIR)/action.c \
13 $(COMMON_DIR)/action_tapping.c \
14 $(COMMON_DIR)/action_macro.c \
15 $(COMMON_DIR)/action_layer.c \
16 $(COMMON_DIR)/action_util.c \
17 $(COMMON_DIR)/print.c \
18 $(COMMON_DIR)/debug.c \
19 $(COMMON_DIR)/util.c \
20 $(COMMON_DIR)/eeconfig.c \
21 $(PLATFORM_COMMON_DIR)/suspend.c \
22 $(PLATFORM_COMMON_DIR)/timer.c \
23 $(PLATFORM_COMMON_DIR)/bootloader.c \
25 ifeq ($(PLATFORM),AVR)
26 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
29 ifeq ($(PLATFORM),CHIBIOS)
30 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c
31 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
37 ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
38 TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE
39 TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c
41 TMK_COMMON_DEFS += -DMAGIC_ENABLE
42 TMK_COMMON_SRC += $(COMMON_DIR)/magic.c
45 ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
46 TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c
47 TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE
48 TMK_COMMON_DEFS += -DMOUSE_ENABLE
51 ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
52 TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE
55 ifeq ($(strip $(RAW_ENABLE)), yes)
56 TMK_COMMON_DEFS += -DRAW_ENABLE
59 ifeq ($(strip $(CONSOLE_ENABLE)), yes)
60 TMK_COMMON_DEFS += -DCONSOLE_ENABLE
62 TMK_COMMON_DEFS += -DNO_PRINT
63 TMK_COMMON_DEFS += -DNO_DEBUG
66 ifeq ($(strip $(COMMAND_ENABLE)), yes)
67 TMK_COMMON_SRC += $(COMMON_DIR)/command.c
68 TMK_COMMON_DEFS += -DCOMMAND_ENABLE
71 ifeq ($(strip $(NKRO_ENABLE)), yes)
72 TMK_COMMON_DEFS += -DNKRO_ENABLE
75 ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
76 TMK_COMMON_DEFS += -DUSB_6KRO_ENABLE
79 ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
80 TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
81 TMK_COMMON_DEFS += -DSLEEP_LED_ENABLE
82 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
85 ifeq ($(strip $(NO_UART)), yes)
86 TMK_COMMON_DEFS += -DNO_UART
89 ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes)
90 TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN
93 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
94 TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c
95 TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE
98 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
99 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
100 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
103 ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
104 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
105 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_BLE
106 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
109 ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
110 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
111 TMK_COMMON_DEFS += -DMODULE_ADAFRUIT_EZKEY
112 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
115 ifeq ($(strip $(BLUETOOTH)), RN42)
116 TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE
117 TMK_COMMON_DEFS += -DMODULE_RN42
118 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
121 ifeq ($(strip $(ONEHAND_ENABLE)), yes)
122 TMK_COMMON_DEFS += -DONEHAND_ENABLE
125 ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
126 TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
129 ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
130 TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE
132 ifeq ($(strip $(MCU)),atmega32u2)
133 TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
134 else ifeq ($(strip $(MCU)),atmega32u4)
135 TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
137 TMK_COMMON_LDFLAGS = $(error no ldscript for keymap section)
142 ifdef STM32_BOOTLOADER_ADDRESS
143 TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
147 VPATH += $(TMK_PATH)/$(COMMON_DIR)
148 ifeq ($(PLATFORM),CHIBIOS)
149 VPATH += $(TMK_PATH)/$(COMMON_DIR)/chibios