generic_features.mk 1.8 KB

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