aboutsummaryrefslogtreecommitdiff
path: root/common_features.mk
diff options
context:
space:
mode:
Diffstat (limited to 'common_features.mk')
-rw-r--r--common_features.mk152
1 files changed, 152 insertions, 0 deletions
diff --git a/common_features.mk b/common_features.mk
new file mode 100644
index 000000000..a8a52afb9
--- /dev/null
+++ b/common_features.mk
@@ -0,0 +1,152 @@
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
21
22ifeq ($(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
27 MIDI_ENABLE=yes
28endif
29
30MUSIC_ENABLE := 0
31
32ifeq ($(strip $(AUDIO_ENABLE)), yes)
33 OPT_DEFS += -DAUDIO_ENABLE
34 MUSIC_ENABLE := 1
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
39endif
40
41ifeq ($(strip $(MIDI_ENABLE)), yes)
42 OPT_DEFS += -DMIDI_ENABLE
43 MUSIC_ENABLE := 1
44 SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
45endif
46
47ifeq ($(MUSIC_ENABLE), 1)
48 SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
49endif
50
51ifeq ($(strip $(COMBO_ENABLE)), yes)
52 OPT_DEFS += -DCOMBO_ENABLE
53 SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
54endif
55
56ifeq ($(strip $(VIRTSER_ENABLE)), yes)
57 OPT_DEFS += -DVIRTSER_ENABLE
58endif
59
60ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
61 OPT_DEFS += -DFAUXCLICKY_ENABLE
62 SRC += $(QUANTUM_DIR)/fauxclicky.c
63endif
64
65ifeq ($(strip $(UCIS_ENABLE)), yes)
66 OPT_DEFS += -DUCIS_ENABLE
67 UNICODE_COMMON = yes
68 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
69endif
70
71ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
72 OPT_DEFS += -DUNICODEMAP_ENABLE
73 UNICODE_COMMON = yes
74 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
75endif
76
77ifeq ($(strip $(UNICODE_ENABLE)), yes)
78 OPT_DEFS += -DUNICODE_ENABLE
79 UNICODE_COMMON = yes
80 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
81endif
82
83ifeq ($(strip $(UNICODE_COMMON)), yes)
84 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
85endif
86
87ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
88 OPT_DEFS += -DRGBLIGHT_ENABLE
89 SRC += $(QUANTUM_DIR)/light_ws2812.c
90 SRC += $(QUANTUM_DIR)/rgblight.c
91 CIE1931_CURVE = yes
92 LED_BREATHING_TABLE = yes
93endif
94
95ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
96 OPT_DEFS += -DTAP_DANCE_ENABLE
97 SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
98endif
99
100ifeq ($(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
104endif
105
106ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
107 SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
108 OPT_DEFS += $(SERIAL_DEFS)
109 VAPTH += $(SERIAL_PATH)
110endif
111
112ifneq ($(strip $(VARIABLE_TRACE)),)
113 SRC += $(QUANTUM_DIR)/variable_trace.c
114 OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
115ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
116 OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
117endif
118endif
119
120ifeq ($(strip $(LCD_ENABLE)), yes)
121 CIE1931_CURVE = yes
122endif
123
124ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
125 ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
126 CIE1931_CURVE = yes
127 endif
128endif
129
130ifeq ($(strip $(CIE1931_CURVE)), yes)
131 OPT_DEFS += -DUSE_CIE1931_CURVE
132 LED_TABLES = yes
133endif
134
135ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
136 OPT_DEFS += -DUSE_LED_BREATHING_TABLE
137 LED_TABLES = yes
138endif
139
140ifeq ($(strip $(LED_TABLES)), yes)
141 SRC += $(QUANTUM_DIR)/led_tables.c
142endif
143
144QUANTUM_SRC:= \
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
149
150ifndef CUSTOM_MATRIX
151 QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
152endif \ No newline at end of file