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