aboutsummaryrefslogtreecommitdiff
path: root/generic_features.mk
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-10-17 22:37:48 +0100
committerGitHub <noreply@github.com>2021-10-17 22:37:48 +0100
commitbd2f8ab88a8d1598cde47d3238ae8a49f1d7fbf9 (patch)
treed029505cd77fbf9a549017dbe28ef181632c226b /generic_features.mk
parentbb80b2a40cd37042b25c721033c531f8c8d0cb16 (diff)
downloadqmk_firmware-bd2f8ab88a8d1598cde47d3238ae8a49f1d7fbf9.tar.gz
qmk_firmware-bd2f8ab88a8d1598cde47d3238ae8a49f1d7fbf9.zip
Infer more when building features (#13890)
Diffstat (limited to 'generic_features.mk')
-rw-r--r--generic_features.mk48
1 files changed, 48 insertions, 0 deletions
diff --git a/generic_features.mk b/generic_features.mk
new file mode 100644
index 000000000..c455c83dd
--- /dev/null
+++ b/generic_features.mk
@@ -0,0 +1,48 @@
1# Copyright 2021 QMK
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
16SPACE_CADET_ENABLE ?= yes
17GRAVE_ESC_ENABLE ?= yes
18
19GENERIC_FEATURES = \
20 COMBO \
21 COMMAND \
22 DIGITIZER \
23 DIP_SWITCH \
24 DYNAMIC_KEYMAP \
25 DYNAMIC_MACRO \
26 ENCODER \
27 GRAVE_ESC \
28 KEY_LOCK \
29 KEY_OVERRIDE \
30 LEADER \
31 PROGRAMMABLE_BUTTON \
32 SPACE_CADET \
33 TAP_DANCE \
34 VELOCIKEY \
35 WPM \
36
37define HANDLE_GENERIC_FEATURE
38 # $$(info "Processing: $1_ENABLE $2.c")
39 SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c)
40 SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c)
41 OPT_DEFS += -D$1_ENABLE
42endef
43
44$(foreach F,$(GENERIC_FEATURES),\
45 $(if $(filter yes, $(strip $($(F)_ENABLE))),\
46 $(eval $(call HANDLE_GENERIC_FEATURE,$(F),$(shell echo $(F) | tr '[:upper:]' '[:lower:]'))) \
47 ) \
48)