Added readme, fixed eql vs plus
[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
37 SRC += $(QUANTUM_DIR)/audio/audio.c
38 SRC += $(QUANTUM_DIR)/audio/voices.c
39 SRC += $(QUANTUM_DIR)/audio/luts.c
40endif
41
42ifeq ($(strip $(MIDI_ENABLE)), yes)
43 OPT_DEFS += -DMIDI_ENABLE
44 MUSIC_ENABLE := 1
45 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
46endif
47
48ifeq ($(MUSIC_ENABLE), 1)
49 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
50endif
51
52ifeq ($(strip $(COMBO_ENABLE)), yes)
53 OPT_DEFS += -DCOMBO_ENABLE
54 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
55endif
56
5987f679
JW
57ifeq ($(strip $(STENO_ENABLE)), yes)
58 OPT_DEFS += -DSTENO_ENABLE
59 VIRTSER_ENABLE := yes
60 SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
61endif
62
1c0fe956
FS
63ifeq ($(strip $(VIRTSER_ENABLE)), yes)
64 OPT_DEFS += -DVIRTSER_ENABLE
65endif
66
67ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
68 OPT_DEFS += -DFAUXCLICKY_ENABLE
69 SRC += $(QUANTUM_DIR)/fauxclicky.c
70endif
71
72ifeq ($(strip $(UCIS_ENABLE)), yes)
73 OPT_DEFS += -DUCIS_ENABLE
74 UNICODE_COMMON = yes
75 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
76endif
77
78ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
79 OPT_DEFS += -DUNICODEMAP_ENABLE
80 UNICODE_COMMON = yes
81 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
82endif
83
84ifeq ($(strip $(UNICODE_ENABLE)), yes)
85 OPT_DEFS += -DUNICODE_ENABLE
86 UNICODE_COMMON = yes
87 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
88endif
89
90ifeq ($(strip $(UNICODE_COMMON)), yes)
91 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
92endif
93
94ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
95 OPT_DEFS += -DRGBLIGHT_ENABLE
42d5a324 96 SRC += ws2812.c
1c0fe956
FS
97 SRC += $(QUANTUM_DIR)/rgblight.c
98 CIE1931_CURVE = yes
99 LED_BREATHING_TABLE = yes
100endif
101
102ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
103 OPT_DEFS += -DTAP_DANCE_ENABLE
104 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
105endif
106
107ifeq ($(strip $(PRINTING_ENABLE)), yes)
108 OPT_DEFS += -DPRINTING_ENABLE
109 SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
110 SRC += $(TMK_DIR)/protocol/serial_uart.c
111endif
112
113ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
114 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
115 OPT_DEFS += $(SERIAL_DEFS)
116 VAPTH += $(SERIAL_PATH)
117endif
118
119ifneq ($(strip $(VARIABLE_TRACE)),)
120 SRC += $(QUANTUM_DIR)/variable_trace.c
121 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
122ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
123 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
124endif
125endif
126
127ifeq ($(strip $(LCD_ENABLE)), yes)
128 CIE1931_CURVE = yes
129endif
130
131ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
132 ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
133 CIE1931_CURVE = yes
134 endif
135endif
136
137ifeq ($(strip $(CIE1931_CURVE)), yes)
138 OPT_DEFS += -DUSE_CIE1931_CURVE
139 LED_TABLES = yes
140endif
141
142ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
143 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
144 LED_TABLES = yes
145endif
146
147ifeq ($(strip $(LED_TABLES)), yes)
148 SRC += $(QUANTUM_DIR)/led_tables.c
149endif
150
151QUANTUM_SRC:= \
152 $(QUANTUM_DIR)/quantum.c \
153 $(QUANTUM_DIR)/keymap_common.c \
154 $(QUANTUM_DIR)/keycode_config.c \
155 $(QUANTUM_DIR)/process_keycode/process_leader.c
156
157ifndef CUSTOM_MATRIX
158 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
159endif