1 # Copyright 2017 Fred Sundvik
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.
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.
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/>.
16 SERIAL_DIR := $(QUANTUM_DIR)/serial_link
17 SERIAL_PATH := $(QUANTUM_PATH)/serial_link
18 SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
19 SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
20 SERIAL_DEFS += -DSERIAL_LINK_ENABLE
21 COMMON_VPATH += $(SERIAL_PATH)
23 ifeq ($(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
33 ifeq ($(strip $(AUDIO_ENABLE)), yes)
34 OPT_DEFS += -DAUDIO_ENABLE
36 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
37 ifeq ($(PLATFORM),AVR)
38 SRC += $(QUANTUM_DIR)/audio/audio.c
40 SRC += $(QUANTUM_DIR)/audio/audio_arm.c
42 SRC += $(QUANTUM_DIR)/audio/voices.c
43 SRC += $(QUANTUM_DIR)/audio/luts.c
46 ifeq ($(strip $(MIDI_ENABLE)), yes)
47 OPT_DEFS += -DMIDI_ENABLE
49 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
52 ifeq ($(MUSIC_ENABLE), 1)
53 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
56 ifeq ($(strip $(COMBO_ENABLE)), yes)
57 OPT_DEFS += -DCOMBO_ENABLE
58 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
61 ifeq ($(strip $(STENO_ENABLE)), yes)
62 OPT_DEFS += -DSTENO_ENABLE
64 SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
67 ifeq ($(strip $(VIRTSER_ENABLE)), yes)
68 OPT_DEFS += -DVIRTSER_ENABLE
71 ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
72 OPT_DEFS += -DFAUXCLICKY_ENABLE
73 SRC += $(QUANTUM_DIR)/fauxclicky.c
76 ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
77 OPT_DEFS += -DPOINTING_DEVICE_ENABLE
78 OPT_DEFS += -DMOUSE_ENABLE
79 SRC += $(QUANTUM_DIR)/pointing_device.c
82 ifeq ($(strip $(UCIS_ENABLE)), yes)
83 OPT_DEFS += -DUCIS_ENABLE
85 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
88 ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
89 OPT_DEFS += -DUNICODEMAP_ENABLE
91 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
94 ifeq ($(strip $(UNICODE_ENABLE)), yes)
95 OPT_DEFS += -DUNICODE_ENABLE
97 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
100 ifeq ($(strip $(UNICODE_COMMON)), yes)
101 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
104 ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
105 OPT_DEFS += -DRGBLIGHT_ENABLE
106 SRC += $(QUANTUM_DIR)/rgblight.c
108 LED_BREATHING_TABLE = yes
109 ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
110 OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
116 ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
117 OPT_DEFS += -DTAP_DANCE_ENABLE
118 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
121 ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
122 OPT_DEFS += -DKEY_LOCK_ENABLE
123 SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
126 ifeq ($(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
132 ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
133 OPT_DEFS += -DAUTO_SHIFT_ENABLE
134 SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
137 ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
138 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
139 OPT_DEFS += $(SERIAL_DEFS)
140 VAPTH += $(SERIAL_PATH)
143 ifneq ($(strip $(VARIABLE_TRACE)),)
144 SRC += $(QUANTUM_DIR)/variable_trace.c
145 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
146 ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
147 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
151 ifeq ($(strip $(LCD_ENABLE)), yes)
155 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
156 ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
159 ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
160 OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
164 ifeq ($(strip $(CIE1931_CURVE)), yes)
165 OPT_DEFS += -DUSE_CIE1931_CURVE
169 ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
170 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
174 ifeq ($(strip $(LED_TABLES)), yes)
175 SRC += $(QUANTUM_DIR)/led_tables.c
178 ifeq ($(strip $(TERMINAL_ENABLE)), yes)
179 SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
180 OPT_DEFS += -DTERMINAL_ENABLE
183 ifeq ($(strip $(USB_HID_ENABLE)), yes)
184 include $(TMK_DIR)/protocol/usb_hid.mk
188 $(QUANTUM_DIR)/quantum.c \
189 $(QUANTUM_DIR)/keymap_common.c \
190 $(QUANTUM_DIR)/keycode_config.c \
191 $(QUANTUM_DIR)/process_keycode/process_leader.c
194 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c