3 PLATFORM_COMMON_DIR = $(COMMON_DIR)/avr
4 else ifeq ($(PLATFORM),CHIBIOS)
5 PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios
8 SRC += $(COMMON_DIR)/host.c \
9 $(COMMON_DIR)/keyboard.c \
10 $(COMMON_DIR)/action.c \
11 $(COMMON_DIR)/action_tapping.c \
12 $(COMMON_DIR)/action_macro.c \
13 $(COMMON_DIR)/action_layer.c \
14 $(COMMON_DIR)/action_util.c \
15 $(COMMON_DIR)/print.c \
16 $(COMMON_DIR)/debug.c \
17 $(COMMON_DIR)/util.c \
18 $(COMMON_DIR)/eeconfig.c \
19 $(PLATFORM_COMMON_DIR)/suspend.c \
20 $(PLATFORM_COMMON_DIR)/timer.c \
21 $(PLATFORM_COMMON_DIR)/bootloader.c \
23 ifeq ($(PLATFORM),AVR)
24 SRC += $(PLATFORM_COMMON_DIR)/xprintf.S
27 ifeq ($(PLATFORM),CHIBIOS)
28 SRC += $(PLATFORM_COMMON_DIR)/printf.c
29 SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
35 ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
36 OPT_DEFS += -DBOOTMAGIC_ENABLE
37 SRC += $(COMMON_DIR)/bootmagic.c
39 OPT_DEFS += -DMAGIC_ENABLE
40 SRC += $(COMMON_DIR)/magic.c
43 ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
44 SRC += $(COMMON_DIR)/mousekey.c
45 OPT_DEFS += -DMOUSEKEY_ENABLE
46 OPT_DEFS += -DMOUSE_ENABLE
49 ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
50 OPT_DEFS += -DEXTRAKEY_ENABLE
53 ifeq ($(strip $(CONSOLE_ENABLE)), yes)
54 OPT_DEFS += -DCONSOLE_ENABLE
56 OPT_DEFS += -DNO_PRINT
57 OPT_DEFS += -DNO_DEBUG
60 ifeq ($(strip $(COMMAND_ENABLE)), yes)
61 SRC += $(COMMON_DIR)/command.c
62 OPT_DEFS += -DCOMMAND_ENABLE
65 ifeq ($(strip $(NKRO_ENABLE)), yes)
66 OPT_DEFS += -DNKRO_ENABLE
69 ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
70 OPT_DEFS += -DUSB_6KRO_ENABLE
73 ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
74 SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
75 OPT_DEFS += -DSLEEP_LED_ENABLE
76 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
79 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
80 SRC += $(COMMON_DIR)/backlight.c
81 OPT_DEFS += -DBACKLIGHT_ENABLE
84 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
85 OPT_DEFS += -DBLUETOOTH_ENABLE
88 ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
89 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
91 ifeq ($(strip $(MCU)),atmega32u2)
92 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
93 else ifeq ($(strip $(MCU)),atmega32u4)
94 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
96 EXTRALDFLAGS = $(error no ldscript for keymap section)
100 ifeq ($(MASTER),right)
101 OPT_DEFS += -DMASTER_IS_ON_RIGHT
103 ifneq ($(MASTER),left)
104 $(error MASTER does not have a valid value(left/right))
110 OPT_DEFS += -DVERSION=$(GIT_VERSION)
113 ifdef STM32_BOOTLOADER_ADDRESS
114 OPT_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
118 VPATH += $(TMK_PATH)/$(COMMON_DIR)
119 ifeq ($(PLATFORM),CHIBIOS)
120 VPATH += $(TMK_PATH)/$(COMMON_DIR)/chibios