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
22 ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
23 OPT_DEFS += -DAPI_SYSEX_ENABLE
24 SRC += $(QUANTUM_DIR)/api/api_sysex.c
25 OPT_DEFS += -DAPI_ENABLE
26 SRC += $(QUANTUM_DIR)/api.c
32 ifeq ($(strip $(AUDIO_ENABLE)), yes)
33 OPT_DEFS += -DAUDIO_ENABLE
35 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
36 SRC += $(QUANTUM_DIR)/audio/audio.c
37 SRC += $(QUANTUM_DIR)/audio/voices.c
38 SRC += $(QUANTUM_DIR)/audio/luts.c
41 ifeq ($(strip $(MIDI_ENABLE)), yes)
42 OPT_DEFS += -DMIDI_ENABLE
44 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
47 ifeq ($(MUSIC_ENABLE), 1)
48 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
51 ifeq ($(strip $(COMBO_ENABLE)), yes)
52 OPT_DEFS += -DCOMBO_ENABLE
53 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
56 ifeq ($(strip $(VIRTSER_ENABLE)), yes)
57 OPT_DEFS += -DVIRTSER_ENABLE
60 ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
61 OPT_DEFS += -DFAUXCLICKY_ENABLE
62 SRC += $(QUANTUM_DIR)/fauxclicky.c
65 ifeq ($(strip $(UCIS_ENABLE)), yes)
66 OPT_DEFS += -DUCIS_ENABLE
68 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
71 ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
72 OPT_DEFS += -DUNICODEMAP_ENABLE
74 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
77 ifeq ($(strip $(UNICODE_ENABLE)), yes)
78 OPT_DEFS += -DUNICODE_ENABLE
80 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
83 ifeq ($(strip $(UNICODE_COMMON)), yes)
84 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
87 ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
88 OPT_DEFS += -DRGBLIGHT_ENABLE
89 SRC += $(QUANTUM_DIR)/light_ws2812.c
90 SRC += $(QUANTUM_DIR)/rgblight.c
92 LED_BREATHING_TABLE = yes
95 ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
96 OPT_DEFS += -DTAP_DANCE_ENABLE
97 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
100 ifeq ($(strip $(PRINTING_ENABLE)), yes)
101 OPT_DEFS += -DPRINTING_ENABLE
102 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
103 SRC += $(TMK_DIR)/protocol/serial_uart.c
106 ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
107 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
108 OPT_DEFS += $(SERIAL_DEFS)
109 VAPTH += $(SERIAL_PATH)
112 ifneq ($(strip $(VARIABLE_TRACE)),)
113 SRC += $(QUANTUM_DIR)/variable_trace.c
114 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
115 ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
116 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
120 ifeq ($(strip $(LCD_ENABLE)), yes)
124 ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
125 ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
130 ifeq ($(strip $(CIE1931_CURVE)), yes)
131 OPT_DEFS += -DUSE_CIE1931_CURVE
135 ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
136 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
140 ifeq ($(strip $(LED_TABLES)), yes)
141 SRC += $(QUANTUM_DIR)/led_tables.c
145 $(QUANTUM_DIR)/quantum.c \
146 $(QUANTUM_DIR)/keymap_common.c \
147 $(QUANTUM_DIR)/keycode_config.c \
148 $(QUANTUM_DIR)/process_keycode/process_leader.c
151 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c