qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

generic_features.mk (1982B)


      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 
     16 GRAVE_ESC_ENABLE ?= yes
     17 MAGIC_ENABLE ?= yes
     18 SEND_STRING_ENABLE ?= yes
     19 SPACE_CADET_ENABLE ?= yes
     20 
     21 GENERIC_FEATURES = \
     22     AUTO_SHIFT \
     23     AUTOCORRECT \
     24     BATTERY \
     25     BOOTMAGIC \
     26     CAPS_WORD \
     27     COMBO \
     28     COMMAND \
     29     CONNECTION \
     30     CRC \
     31     DEFERRED_EXEC \
     32     DIGITIZER \
     33     DIP_SWITCH \
     34     DYNAMIC_KEYMAP \
     35     DYNAMIC_MACRO \
     36     DYNAMIC_TAPPING_TERM \
     37     GRAVE_ESC \
     38     HAPTIC \
     39     KEYCODE_STRING \
     40     KEY_LOCK \
     41     KEY_OVERRIDE \
     42     LAYER_LOCK \
     43     LEADER \
     44     MAGIC \
     45     MOUSEKEY \
     46     MUSIC \
     47     OS_DETECTION \
     48     PROGRAMMABLE_BUTTON \
     49     REPEAT_KEY \
     50     SECURE \
     51     SEND_STRING \
     52     SEQUENCER \
     53     SPACE_CADET \
     54     SWAP_HANDS \
     55     TAP_DANCE \
     56     TRI_LAYER \
     57     VIA \
     58     VIRTSER \
     59     WPM \
     60 
     61 define HANDLE_GENERIC_FEATURE
     62     # $$(info "Processing: $1_ENABLE $2.c")
     63     SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c)
     64     SRC += $$(wildcard $$(QUANTUM_DIR)/$2/$2.c)
     65     SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c)
     66     SRC += $$(wildcard $$(QUANTUM_DIR)/nvm/$$(NVM_DRIVER_LOWER)/nvm_$2.c)
     67     VPATH += $$(wildcard $$(QUANTUM_DIR)/$2/)
     68     OPT_DEFS += -D$1_ENABLE
     69 endef
     70 
     71 $(foreach F,$(GENERIC_FEATURES),\
     72     $(if $(filter yes, $(strip $($(F)_ENABLE))),\
     73         $(eval $(call HANDLE_GENERIC_FEATURE,$(F),$(shell echo $(F) | tr '[:upper:]' '[:lower:]'))) \
     74     ) \
     75 )