Add chiwi60 layout for the do60
[jackhill/qmk/firmware.git] / common_features.mk
CommitLineData
1c0fe956
FS
1# Copyright 2017 Fred Sundvik
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation, either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16SERIAL_DIR := $(QUANTUM_DIR)/serial_link
17SERIAL_PATH := $(QUANTUM_PATH)/serial_link
18SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
19SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
20SERIAL_DEFS += -DSERIAL_LINK_ENABLE
1aa0be4c 21COMMON_VPATH += $(SERIAL_PATH)
1c0fe956
FS
22
23ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
24 OPT_DEFS += -DAPI_SYSEX_ENABLE
25 SRC += $(QUANTUM_DIR)/api/api_sysex.c
26 OPT_DEFS += -DAPI_ENABLE
27 SRC += $(QUANTUM_DIR)/api.c
28 MIDI_ENABLE=yes
29endif
30
31MUSIC_ENABLE := 0
32
33ifeq ($(strip $(AUDIO_ENABLE)), yes)
34 OPT_DEFS += -DAUDIO_ENABLE
35 MUSIC_ENABLE := 1
36 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
5836d1a0 37 ifeq ($(PLATFORM),AVR)
38 SRC += $(QUANTUM_DIR)/audio/audio.c
39 else
40 SRC += $(QUANTUM_DIR)/audio/audio_arm.c
41 endif
1c0fe956
FS
42 SRC += $(QUANTUM_DIR)/audio/voices.c
43 SRC += $(QUANTUM_DIR)/audio/luts.c
44endif
45
46ifeq ($(strip $(MIDI_ENABLE)), yes)
47 OPT_DEFS += -DMIDI_ENABLE
48 MUSIC_ENABLE := 1
49 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
50endif
51
52ifeq ($(MUSIC_ENABLE), 1)
53 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
54endif
55
56ifeq ($(strip $(COMBO_ENABLE)), yes)
57 OPT_DEFS += -DCOMBO_ENABLE
58 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
59endif
60
5987f679
JW
61ifeq ($(strip $(STENO_ENABLE)), yes)
62 OPT_DEFS += -DSTENO_ENABLE
63 VIRTSER_ENABLE := yes
64 SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
65endif
66
1c0fe956
FS
67ifeq ($(strip $(VIRTSER_ENABLE)), yes)
68 OPT_DEFS += -DVIRTSER_ENABLE
69endif
70
71ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
72 OPT_DEFS += -DFAUXCLICKY_ENABLE
73 SRC += $(QUANTUM_DIR)/fauxclicky.c
74endif
75
ee132284 76ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
2d77f9cb
RR
77 OPT_DEFS += -DPOINTING_DEVICE_ENABLE
78 OPT_DEFS += -DMOUSE_ENABLE
79 SRC += $(QUANTUM_DIR)/pointing_device.c
ee132284
S
80endif
81
1c0fe956
FS
82ifeq ($(strip $(UCIS_ENABLE)), yes)
83 OPT_DEFS += -DUCIS_ENABLE
84 UNICODE_COMMON = yes
85 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
86endif
87
88ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
89 OPT_DEFS += -DUNICODEMAP_ENABLE
90 UNICODE_COMMON = yes
91 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
92endif
93
94ifeq ($(strip $(UNICODE_ENABLE)), yes)
95 OPT_DEFS += -DUNICODE_ENABLE
96 UNICODE_COMMON = yes
97 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
98endif
99
100ifeq ($(strip $(UNICODE_COMMON)), yes)
101 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
102endif
103
104ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
105 OPT_DEFS += -DRGBLIGHT_ENABLE
024f0455 106 SRC += $(QUANTUM_DIR)/rgblight.c
1c0fe956
FS
107 CIE1931_CURVE = yes
108 LED_BREATHING_TABLE = yes
d5486265
LR
109 ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
110 OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
111 else
024f0455 112 SRC += ws2812.c
d5486265 113 endif
1c0fe956
FS
114endif
115
116ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
117 OPT_DEFS += -DTAP_DANCE_ENABLE
118 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
119endif
120
8e1be7c7
FS
121ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
122 OPT_DEFS += -DKEY_LOCK_ENABLE
123 SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
124endif
125
1c0fe956
FS
126ifeq ($(strip $(PRINTING_ENABLE)), yes)
127 OPT_DEFS += -DPRINTING_ENABLE
128 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
129 SRC += $(TMK_DIR)/protocol/serial_uart.c
130endif
131
abba393f
JC
132ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
133 OPT_DEFS += -DAUTO_SHIFT_ENABLE
134 SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
00b4dce6
JS
135 ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
136 OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
137 endif
abba393f
JC
138endif
139
1c0fe956
FS
140ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
141 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
142 OPT_DEFS += $(SERIAL_DEFS)
143 VAPTH += $(SERIAL_PATH)
144endif
145
146ifneq ($(strip $(VARIABLE_TRACE)),)
147 SRC += $(QUANTUM_DIR)/variable_trace.c
148 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
149ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
150 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
151endif
152endif
153
154ifeq ($(strip $(LCD_ENABLE)), yes)
155 CIE1931_CURVE = yes
156endif
157
158ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
159 ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
160 CIE1931_CURVE = yes
365b8635
KA
161 endif
162 ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
163 OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
1c0fe956
FS
164 endif
165endif
166
167ifeq ($(strip $(CIE1931_CURVE)), yes)
168 OPT_DEFS += -DUSE_CIE1931_CURVE
169 LED_TABLES = yes
170endif
171
172ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
173 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
174 LED_TABLES = yes
175endif
176
177ifeq ($(strip $(LED_TABLES)), yes)
178 SRC += $(QUANTUM_DIR)/led_tables.c
179endif
180
7ad924ba
JH
181ifeq ($(strip $(TERMINAL_ENABLE)), yes)
182 SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
183 OPT_DEFS += -DTERMINAL_ENABLE
184endif
185
800ec55d
JH
186ifeq ($(strip $(USB_HID_ENABLE)), yes)
187 include $(TMK_DIR)/protocol/usb_hid.mk
188endif
189
1c0fe956
FS
190QUANTUM_SRC:= \
191 $(QUANTUM_DIR)/quantum.c \
192 $(QUANTUM_DIR)/keymap_common.c \
193 $(QUANTUM_DIR)/keycode_config.c \
194 $(QUANTUM_DIR)/process_keycode/process_leader.c
195
196ifndef CUSTOM_MATRIX
197 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
8e1be7c7 198endif