generic_features.mk 1.8 KB

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