]> git.gir.st - tmk_keyboard.git/blame_incremental - tmk_core/common.mk
core: Modifiers can be used as tap key Fix #422
[tmk_keyboard.git] / tmk_core / common.mk
... / ...
CommitLineData
1COMMON_DIR = common
2SRC += $(COMMON_DIR)/host.c \
3 $(COMMON_DIR)/keyboard.c \
4 $(COMMON_DIR)/matrix.c \
5 $(COMMON_DIR)/action.c \
6 $(COMMON_DIR)/action_tapping.c \
7 $(COMMON_DIR)/action_macro.c \
8 $(COMMON_DIR)/action_layer.c \
9 $(COMMON_DIR)/action_util.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
21ifeq (yes,$(strip $(UNIMAP_ENABLE)))
22 SRC += $(COMMON_DIR)/unimap.c
23 OPT_DEFS += -DUNIMAP_ENABLE
24 OPT_DEFS += -DACTIONMAP_ENABLE
25else
26 ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
27 SRC += $(COMMON_DIR)/actionmap.c
28 OPT_DEFS += -DACTIONMAP_ENABLE
29 else
30 SRC += $(COMMON_DIR)/keymap.c
31 endif
32endif
33
34ifeq (yes,$(strip $(BOOTMAGIC_ENABLE)))
35 SRC += $(COMMON_DIR)/bootmagic.c
36 SRC += $(COMMON_DIR)/avr/eeconfig.c
37 OPT_DEFS += -DBOOTMAGIC_ENABLE
38endif
39
40ifeq (yes,$(strip $(MOUSEKEY_ENABLE)))
41 SRC += $(COMMON_DIR)/mousekey.c
42 OPT_DEFS += -DMOUSEKEY_ENABLE
43 OPT_DEFS += -DMOUSE_ENABLE
44endif
45
46ifeq (yes,$(strip $(EXTRAKEY_ENABLE)))
47 OPT_DEFS += -DEXTRAKEY_ENABLE
48endif
49
50ifeq (yes,$(strip $(CONSOLE_ENABLE)))
51 OPT_DEFS += -DCONSOLE_ENABLE
52else
53 OPT_DEFS += -DNO_PRINT
54 OPT_DEFS += -DNO_DEBUG
55endif
56
57ifeq (yes,$(strip $(COMMAND_ENABLE)))
58 SRC += $(COMMON_DIR)/command.c
59 OPT_DEFS += -DCOMMAND_ENABLE
60endif
61
62ifeq (yes,$(strip $(NKRO_ENABLE)))
63 OPT_DEFS += -DNKRO_ENABLE
64endif
65
66ifeq (yes,$(strip $(USB_6KRO_ENABLE)))
67 OPT_DEFS += -DUSB_6KRO_ENABLE
68endif
69
70ifeq (yes, $(strip $(KEYBOARD_LOCK_ENABLE)))
71 OPT_DEFS += -DKEYBOARD_LOCK_ENABLE
72endif
73
74ifeq (yes,$(strip $(SLEEP_LED_ENABLE)))
75 SRC += $(COMMON_DIR)/avr/sleep_led.c
76 OPT_DEFS += -DSLEEP_LED_ENABLE
77 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
78endif
79
80ifeq (yes,$(strip $(BACKLIGHT_ENABLE)))
81 SRC += $(COMMON_DIR)/backlight.c
82 OPT_DEFS += -DBACKLIGHT_ENABLE
83endif
84
85ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
86 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
87
88 ifeq ($(strip $(MCU)),atmega32u2)
89 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
90 else ifeq ($(strip $(MCU)),atmega32u4)
91 EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
92 else
93 EXTRALDFLAGS = $(error no ldscript for keymap section)
94 endif
95endif
96
97# Version string
98VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
99OPT_DEFS += -DVERSION=$(VERSION)
100
101
102# Search Path
103VPATH += $(TMK_DIR)/common
Imprint / Impressum