]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common.mk
Cleans up quantum/keymap situation, removes extra lufa folders (#416)
[qmk_firmware.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)/print.c \
10         $(COMMON_DIR)/debug.c \
11         $(COMMON_DIR)/util.c \
12         $(COMMON_DIR)/avr/suspend.c \
13         $(COMMON_DIR)/avr/xprintf.S \
14         $(COMMON_DIR)/avr/timer.c \
15         $(COMMON_DIR)/avr/bootloader.c
16
17
18 # Option modules
19 ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes)
20     SRC += $(COMMON_DIR)/bootmagic.c
21     SRC += $(COMMON_DIR)/avr/eeconfig.c
22     OPT_DEFS += -DBOOTMAGIC_ENABLE
23 else
24     SRC += $(COMMON_DIR)/magic.c
25     SRC += $(COMMON_DIR)/avr/eeconfig.c
26 endif
27
28 ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
29     SRC += $(COMMON_DIR)/mousekey.c
30     OPT_DEFS += -DMOUSEKEY_ENABLE
31     OPT_DEFS += -DMOUSE_ENABLE
32 endif
33
34 ifeq ($(strip $(EXTRAKEY_ENABLE)), yes)
35     OPT_DEFS += -DEXTRAKEY_ENABLE
36 endif
37
38 ifeq ($(strip $(CONSOLE_ENABLE)), yes)
39     OPT_DEFS += -DCONSOLE_ENABLE
40 else
41     OPT_DEFS += -DNO_PRINT
42     OPT_DEFS += -DNO_DEBUG
43 endif
44
45 ifeq ($(strip $(COMMAND_ENABLE)), yes)
46     SRC += $(COMMON_DIR)/command.c
47     OPT_DEFS += -DCOMMAND_ENABLE
48 endif
49
50 ifeq ($(strip $(NKRO_ENABLE)), yes)
51     OPT_DEFS += -DNKRO_ENABLE
52 endif
53
54 ifeq ($(strip $(MIDI_ENABLE)), yes)
55     OPT_DEFS += -DMIDI_ENABLE
56 endif
57
58 ifeq ($(strip $(AUDIO_ENABLE)), yes)
59     OPT_DEFS += -DAUDIO_ENABLE
60 endif
61
62 ifeq ($(strip $(UNICODE_ENABLE)), yes)
63     OPT_DEFS += -DUNICODE_ENABLE
64 endif
65
66 ifeq ($(strip $(USB_6KRO_ENABLE)), yes)
67     OPT_DEFS += -DUSB_6KRO_ENABLE
68 endif
69
70 ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
71     SRC += $(COMMON_DIR)/sleep_led.c
72     OPT_DEFS += -DSLEEP_LED_ENABLE
73     OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
74 endif
75
76 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
77     SRC += $(COMMON_DIR)/backlight.c
78     SRC += $(COMMON_DIR)/avr/eeconfig.c
79     OPT_DEFS += -DBACKLIGHT_ENABLE
80 endif
81
82 ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
83     OPT_DEFS += -DBLUETOOTH_ENABLE
84 endif
85
86 ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
87     OPT_DEFS += -DKEYMAP_SECTION_ENABLE
88
89     ifeq ($(strip $(MCU)),atmega32u2)
90         EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
91     else ifeq ($(strip $(MCU)),atmega32u4)
92         EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
93     else
94         EXTRALDFLAGS = $(error no ldscript for keymap section)
95     endif
96 endif
97
98 # Version string
99 OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
100
101
102 # Search Path
103 VPATH += $(TMK_PATH)/$(COMMON_DIR)