]> git.gir.st - tmk_keyboard.git/blob - tmk_core/common.mk
Merge branch 'chibios' of https://github.com/flabbergast/tmk_keyboard into flabbergas...
[tmk_keyboard.git] / tmk_core / common.mk
1 COMMON_DIR = common
2 SRC += $(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 \
13 $(COMMON_DIR)/avr/suspend.c \
14 $(COMMON_DIR)/avr/xprintf.S \
15 $(COMMON_DIR)/avr/timer.c \
16 $(COMMON_DIR)/avr/bootloader.c
17
18
19 # Option modules
20 ifdef BOOTMAGIC_ENABLE
21 SRC += $(COMMON_DIR)/bootmagic.c
22 SRC += $(COMMON_DIR)/avr/eeconfig.c
23 OPT_DEFS += -DBOOTMAGIC_ENABLE
24 endif
25
26 ifdef MOUSEKEY_ENABLE
27 SRC += $(COMMON_DIR)/mousekey.c
28 OPT_DEFS += -DMOUSEKEY_ENABLE
29 OPT_DEFS += -DMOUSE_ENABLE
30 endif
31
32 ifdef EXTRAKEY_ENABLE
33 OPT_DEFS += -DEXTRAKEY_ENABLE
34 endif
35
36 ifdef CONSOLE_ENABLE
37 OPT_DEFS += -DCONSOLE_ENABLE
38 else
39 OPT_DEFS += -DNO_PRINT
40 OPT_DEFS += -DNO_DEBUG
41 endif
42
43 ifdef COMMAND_ENABLE
44 SRC += $(COMMON_DIR)/command.c
45 OPT_DEFS += -DCOMMAND_ENABLE
46 endif
47
48 ifdef NKRO_ENABLE
49 OPT_DEFS += -DNKRO_ENABLE
50 endif
51
52 ifdef USB_6KRO_ENABLE
53 OPT_DEFS += -DUSB_6KRO_ENABLE
54 endif
55
56 ifdef KEYBOARD_LOCK_ENABLE
57 OPT_DEFS += -DKEYBOARD_LOCK_ENABLE
58 endif
59
60 ifdef SLEEP_LED_ENABLE
61 SRC += $(COMMON_DIR)/avr/sleep_led.c
62 OPT_DEFS += -DSLEEP_LED_ENABLE
63 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
64 endif
65
66 ifdef BACKLIGHT_ENABLE
67 SRC += $(COMMON_DIR)/backlight.c
68 OPT_DEFS += -DBACKLIGHT_ENABLE
69 endif
70
71 ifdef KEYMAP_SECTION_ENABLE
72 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
73
74 ifeq ($(strip $(MCU)),atmega32u2)
75 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
76 else ifeq ($(strip $(MCU)),atmega32u4)
77 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
78 else
79 EXTRALDFLAGS = $(error no ldscript for keymap section)
80 endif
81 endif
82
83 # Version string
84 VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
85 OPT_DEFS += -DVERSION=$(VERSION)
86
87
88 # Search Path
89 VPATH += $(TMK_DIR)/common
Imprint / Impressum