logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

generic_features.mk (1968B)


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