Commit | Line | Data |
---|---|---|
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 | ||
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 | |
1aa0be4c | 21 | COMMON_VPATH += $(SERIAL_PATH) |
1c0fe956 FS |
22 | |
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 | |
28 | MIDI_ENABLE=yes | |
29 | endif | |
30 | ||
31 | MUSIC_ENABLE := 0 | |
32 | ||
33 | ifeq ($(strip $(AUDIO_ENABLE)), yes) | |
34 | OPT_DEFS += -DAUDIO_ENABLE | |
35 | MUSIC_ENABLE := 1 | |
36 | SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c | |
37 | SRC += $(QUANTUM_DIR)/audio/audio.c | |
38 | SRC += $(QUANTUM_DIR)/audio/voices.c | |
39 | SRC += $(QUANTUM_DIR)/audio/luts.c | |
40 | endif | |
41 | ||
42 | ifeq ($(strip $(MIDI_ENABLE)), yes) | |
43 | OPT_DEFS += -DMIDI_ENABLE | |
44 | MUSIC_ENABLE := 1 | |
45 | SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c | |
46 | endif | |
47 | ||
48 | ifeq ($(MUSIC_ENABLE), 1) | |
49 | SRC += $(QUANTUM_DIR)/process_keycode/process_music.c | |
50 | endif | |
51 | ||
52 | ifeq ($(strip $(COMBO_ENABLE)), yes) | |
53 | OPT_DEFS += -DCOMBO_ENABLE | |
54 | SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c | |
55 | endif | |
56 | ||
5987f679 JW |
57 | ifeq ($(strip $(STENO_ENABLE)), yes) |
58 | OPT_DEFS += -DSTENO_ENABLE | |
59 | VIRTSER_ENABLE := yes | |
60 | SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c | |
61 | endif | |
62 | ||
1c0fe956 FS |
63 | ifeq ($(strip $(VIRTSER_ENABLE)), yes) |
64 | OPT_DEFS += -DVIRTSER_ENABLE | |
65 | endif | |
66 | ||
67 | ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes) | |
68 | OPT_DEFS += -DFAUXCLICKY_ENABLE | |
69 | SRC += $(QUANTUM_DIR)/fauxclicky.c | |
70 | endif | |
71 | ||
ee132284 S |
72 | ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) |
73 | SRC += $(QUANTUM_DIR)/pointing_device.c | |
74 | endif | |
75 | ||
1c0fe956 FS |
76 | ifeq ($(strip $(UCIS_ENABLE)), yes) |
77 | OPT_DEFS += -DUCIS_ENABLE | |
78 | UNICODE_COMMON = yes | |
79 | SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c | |
80 | endif | |
81 | ||
82 | ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) | |
83 | OPT_DEFS += -DUNICODEMAP_ENABLE | |
84 | UNICODE_COMMON = yes | |
85 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c | |
86 | endif | |
87 | ||
88 | ifeq ($(strip $(UNICODE_ENABLE)), yes) | |
89 | OPT_DEFS += -DUNICODE_ENABLE | |
90 | UNICODE_COMMON = yes | |
91 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c | |
92 | endif | |
93 | ||
94 | ifeq ($(strip $(UNICODE_COMMON)), yes) | |
95 | SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c | |
96 | endif | |
97 | ||
98 | ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) | |
99 | OPT_DEFS += -DRGBLIGHT_ENABLE | |
024f0455 | 100 | SRC += $(QUANTUM_DIR)/rgblight.c |
1c0fe956 FS |
101 | CIE1931_CURVE = yes |
102 | LED_BREATHING_TABLE = yes | |
d5486265 LR |
103 | ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) |
104 | OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER | |
105 | else | |
024f0455 | 106 | SRC += ws2812.c |
d5486265 | 107 | endif |
1c0fe956 FS |
108 | endif |
109 | ||
110 | ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) | |
111 | OPT_DEFS += -DTAP_DANCE_ENABLE | |
112 | SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c | |
113 | endif | |
114 | ||
8e1be7c7 FS |
115 | ifeq ($(strip $(KEY_LOCK_ENABLE)), yes) |
116 | OPT_DEFS += -DKEY_LOCK_ENABLE | |
117 | SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c | |
118 | endif | |
119 | ||
1c0fe956 FS |
120 | ifeq ($(strip $(PRINTING_ENABLE)), yes) |
121 | OPT_DEFS += -DPRINTING_ENABLE | |
122 | SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c | |
123 | SRC += $(TMK_DIR)/protocol/serial_uart.c | |
124 | endif | |
125 | ||
abba393f JC |
126 | ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) |
127 | OPT_DEFS += -DAUTO_SHIFT_ENABLE | |
128 | SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c | |
129 | endif | |
130 | ||
1c0fe956 FS |
131 | ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) |
132 | SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) | |
133 | OPT_DEFS += $(SERIAL_DEFS) | |
134 | VAPTH += $(SERIAL_PATH) | |
135 | endif | |
136 | ||
137 | ifneq ($(strip $(VARIABLE_TRACE)),) | |
138 | SRC += $(QUANTUM_DIR)/variable_trace.c | |
139 | OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE)) | |
140 | ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),) | |
141 | OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE)) | |
142 | endif | |
143 | endif | |
144 | ||
145 | ifeq ($(strip $(LCD_ENABLE)), yes) | |
146 | CIE1931_CURVE = yes | |
147 | endif | |
148 | ||
149 | ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) | |
150 | ifeq ($(strip $(VISUALIZER_ENABLE)), yes) | |
151 | CIE1931_CURVE = yes | |
152 | endif | |
153 | endif | |
154 | ||
155 | ifeq ($(strip $(CIE1931_CURVE)), yes) | |
156 | OPT_DEFS += -DUSE_CIE1931_CURVE | |
157 | LED_TABLES = yes | |
158 | endif | |
159 | ||
160 | ifeq ($(strip $(LED_BREATHING_TABLE)), yes) | |
161 | OPT_DEFS += -DUSE_LED_BREATHING_TABLE | |
162 | LED_TABLES = yes | |
163 | endif | |
164 | ||
165 | ifeq ($(strip $(LED_TABLES)), yes) | |
166 | SRC += $(QUANTUM_DIR)/led_tables.c | |
167 | endif | |
168 | ||
7ad924ba JH |
169 | ifeq ($(strip $(TERMINAL_ENABLE)), yes) |
170 | SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c | |
171 | OPT_DEFS += -DTERMINAL_ENABLE | |
172 | endif | |
173 | ||
1c0fe956 FS |
174 | QUANTUM_SRC:= \ |
175 | $(QUANTUM_DIR)/quantum.c \ | |
176 | $(QUANTUM_DIR)/keymap_common.c \ | |
177 | $(QUANTUM_DIR)/keycode_config.c \ | |
178 | $(QUANTUM_DIR)/process_keycode/process_leader.c | |
179 | ||
180 | ifndef CUSTOM_MATRIX | |
181 | QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c | |
8e1be7c7 | 182 | endif |