Squashed 'tmk_core/' changes from d5c5ac6..8da1898
[tmk_keyboard.git] / tool / chibios / common.mk
CommitLineData
28203e90 1COMMON_DIR = $(TMK_DIR)/common
2SRC += $(COMMON_DIR)/host.c \
3 $(COMMON_DIR)/keyboard.c \
4 $(COMMON_DIR)/action.c \
5 $(COMMON_DIR)/action_tapping.c \
6 $(COMMON_DIR)/action_macro.c \
7 $(COMMON_DIR)/action_layer.c \
8 $(COMMON_DIR)/action_util.c \
9 $(COMMON_DIR)/keymap.c \
10 $(COMMON_DIR)/print.c \
11 $(COMMON_DIR)/debug.c \
12 $(COMMON_DIR)/util.c \
71381457 13 $(COMMON_DIR)/hook.c \
28203e90 14 $(COMMON_DIR)/chibios/suspend.c \
15 $(COMMON_DIR)/chibios/printf.c \
16 $(COMMON_DIR)/chibios/timer.c \
17 $(COMMON_DIR)/chibios/bootloader.c
18
19
20# Option modules
21ifdef BOOTMAGIC_ENABLE
22 SRC += $(COMMON_DIR)/bootmagic.c
23 SRC += $(COMMON_DIR)/chibios/eeconfig.c
24 OPT_DEFS += -DBOOTMAGIC_ENABLE
25endif
26
27ifdef MOUSEKEY_ENABLE
28 SRC += $(COMMON_DIR)/mousekey.c
29 OPT_DEFS += -DMOUSEKEY_ENABLE
30 OPT_DEFS += -DMOUSE_ENABLE
31endif
32
33ifdef EXTRAKEY_ENABLE
34 OPT_DEFS += -DEXTRAKEY_ENABLE
35endif
36
37ifdef CONSOLE_ENABLE
38 OPT_DEFS += -DCONSOLE_ENABLE
39else
40 OPT_DEFS += -DNO_PRINT
41 OPT_DEFS += -DNO_DEBUG
42endif
43
44ifdef COMMAND_ENABLE
45 SRC += $(COMMON_DIR)/command.c
46 OPT_DEFS += -DCOMMAND_ENABLE
47endif
48
49ifdef NKRO_ENABLE
50 OPT_DEFS += -DNKRO_ENABLE
51endif
52
53ifdef USB_6KRO_ENABLE
54 OPT_DEFS += -DUSB_6KRO_ENABLE
55endif
56
57ifdef SLEEP_LED_ENABLE
58 SRC += $(COMMON_DIR)/chibios/sleep_led.c
59 OPT_DEFS += -DSLEEP_LED_ENABLE
60 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
61endif
62
63ifdef BACKLIGHT_ENABLE
64 SRC += $(COMMON_DIR)/backlight.c
65 OPT_DEFS += -DBACKLIGHT_ENABLE
66endif
67
68ifdef KEYMAP_SECTION_ENABLE
69 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
70
71 ifeq ($(strip $(MCU)),atmega32u2)
72 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
73 else ifeq ($(strip $(MCU)),atmega32u4)
74 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
75 else
76 EXTRALDFLAGS = $(error no ldscript for keymap section)
77 endif
78endif
79
80# Version string
81OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
82
83# Bootloader address
71381457 84ifdef STM32_BOOTLOADER_ADDRESS
85 OPT_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS)
28203e90 86endif
Imprint / Impressum