]> git.gir.st - tmk_keyboard.git/blame - tmk_core/common.mk
remove experimental return, cleanup slash_question key
[tmk_keyboard.git] / tmk_core / common.mk
CommitLineData
5a0132f1 1COMMON_DIR = common
a074364c 2SRC += $(COMMON_DIR)/host.c \
3 $(COMMON_DIR)/keyboard.c \
f76a786b 4 $(COMMON_DIR)/matrix.c \
a074364c 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 \
a074364c 10 $(COMMON_DIR)/print.c \
11 $(COMMON_DIR)/debug.c \
12 $(COMMON_DIR)/util.c \
71381457 13 $(COMMON_DIR)/hook.c \
a074364c 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
765d82e8 21ifeq (yes,$(strip $(UNIMAP_ENABLE)))
e84a5981 22 SRC += $(COMMON_DIR)/unimap.c
23 OPT_DEFS += -DUNIMAP_ENABLE
c98e89f2 24 OPT_DEFS += -DACTIONMAP_ENABLE
5e9b21d7 25else
765d82e8 26 ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
e84a5981 27 SRC += $(COMMON_DIR)/actionmap.c
28 OPT_DEFS += -DACTIONMAP_ENABLE
29 else
30 SRC += $(COMMON_DIR)/keymap.c
31 endif
5e9b21d7 32endif
33
765d82e8 34ifeq (yes,$(strip $(BOOTMAGIC_ENABLE)))
a074364c 35 SRC += $(COMMON_DIR)/bootmagic.c
36 SRC += $(COMMON_DIR)/avr/eeconfig.c
37 OPT_DEFS += -DBOOTMAGIC_ENABLE
38endif
39
765d82e8 40ifeq (yes,$(strip $(MOUSEKEY_ENABLE)))
a074364c 41 SRC += $(COMMON_DIR)/mousekey.c
42 OPT_DEFS += -DMOUSEKEY_ENABLE
43 OPT_DEFS += -DMOUSE_ENABLE
44endif
45
765d82e8 46ifeq (yes,$(strip $(EXTRAKEY_ENABLE)))
a074364c 47 OPT_DEFS += -DEXTRAKEY_ENABLE
48endif
49
765d82e8 50ifeq (yes,$(strip $(CONSOLE_ENABLE)))
a074364c 51 OPT_DEFS += -DCONSOLE_ENABLE
52else
53 OPT_DEFS += -DNO_PRINT
54 OPT_DEFS += -DNO_DEBUG
55endif
56
765d82e8 57ifeq (yes,$(strip $(COMMAND_ENABLE)))
a074364c 58 SRC += $(COMMON_DIR)/command.c
59 OPT_DEFS += -DCOMMAND_ENABLE
60endif
61
765d82e8 62ifeq (yes,$(strip $(NKRO_ENABLE)))
a074364c 63 OPT_DEFS += -DNKRO_ENABLE
64endif
65
765d82e8 66ifeq (yes,$(strip $(USB_6KRO_ENABLE)))
a074364c 67 OPT_DEFS += -DUSB_6KRO_ENABLE
68endif
69
765d82e8 70ifeq (yes, $(strip $(KEYBOARD_LOCK_ENABLE)))
28203e90 71 OPT_DEFS += -DKEYBOARD_LOCK_ENABLE
72endif
73
765d82e8 74ifeq (yes,$(strip $(SLEEP_LED_ENABLE)))
28203e90 75 SRC += $(COMMON_DIR)/avr/sleep_led.c
a074364c 76 OPT_DEFS += -DSLEEP_LED_ENABLE
77 OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
78endif
79
765d82e8 80ifeq (yes,$(strip $(BACKLIGHT_ENABLE)))
a074364c 81 SRC += $(COMMON_DIR)/backlight.c
82 OPT_DEFS += -DBACKLIGHT_ENABLE
83endif
84
765d82e8 85ifeq (yes,$(strip $(KEYMAP_SECTION_ENABLE)))
a074364c 86 OPT_DEFS += -DKEYMAP_SECTION_ENABLE
fdc38ef3
JW
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
a074364c 95endif
96
97# Version string
28203e90 98VERSION := $(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
99OPT_DEFS += -DVERSION=$(VERSION)
a074364c 100
101
102# Search Path
103VPATH += $(TMK_DIR)/common
Imprint / Impressum