generic_features.mk 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. SPACE_CADET_ENABLE ?= yes
  16. GRAVE_ESC_ENABLE ?= yes
  17. GENERIC_FEATURES = \
  18. AUTOCORRECT \
  19. CAPS_WORD \
  20. COMBO \
  21. COMMAND \
  22. DEFERRED_EXEC \
  23. DIGITIZER \
  24. DIP_SWITCH \
  25. DYNAMIC_KEYMAP \
  26. DYNAMIC_MACRO \
  27. GRAVE_ESC \
  28. HAPTIC \
  29. KEY_LOCK \
  30. KEY_OVERRIDE \
  31. LEADER \
  32. PROGRAMMABLE_BUTTON \
  33. SECURE \
  34. SPACE_CADET \
  35. SWAP_HANDS \
  36. TAP_DANCE \
  37. VELOCIKEY \
  38. WPM \
  39. DYNAMIC_TAPPING_TERM \
  40. define HANDLE_GENERIC_FEATURE
  41. # $$(info "Processing: $1_ENABLE $2.c")
  42. SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c)
  43. SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c)
  44. OPT_DEFS += -D$1_ENABLE
  45. endef
  46. $(foreach F,$(GENERIC_FEATURES),\
  47. $(if $(filter yes, $(strip $($(F)_ENABLE))),\
  48. $(eval $(call HANDLE_GENERIC_FEATURE,$(F),$(shell echo $(F) | tr '[:upper:]' '[:lower:]'))) \
  49. ) \
  50. )