You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

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