]> git.donarmstrong.com Git - qmk_firmware.git/blob - common.mk
Merge pull request #28 from abienz/master
[qmk_firmware.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)/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 MIDI_ENABLE
53     OPT_DEFS += -DMIDI_ENABLE
54 endif
55
56 ifdef USB_6KRO_ENABLE
57     OPT_DEFS += -DUSB_6KRO_ENABLE
58 endif
59
60 ifdef SLEEP_LED_ENABLE
61     SRC += $(COMMON_DIR)/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 BLUETOOTH_ENABLE
72     OPT_DEFS += -DBLUETOOTH_ENABLE
73 endif
74
75 ifdef KEYMAP_SECTION_ENABLE
76     OPT_DEFS += -DKEYMAP_SECTION_ENABLE
77     EXTRALDFLAGS = -Wl,-L$(TOP_DIR),-Tldscript_keymap_avr5.x
78 endif
79
80 # Version string
81 OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null)
82
83
84 # Search Path
85 VPATH += $(TOP_DIR)/common