generic_features.mk 2.0 KB

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