local_features.mk 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #
  2. # local_features.mk contains post-processing rules for the Helix keyboard.
  3. #
  4. # Post-processing rules convert keyboard-specific shortcuts (that represent
  5. # combinations of standard options) into QMK standard options.
  6. #
  7. define HELIX_CUSTOMISE_MSG
  8. $(info Helix Spacific Build Options)
  9. $(info - OLED_ENABLE = $(OLED_ENABLE))
  10. $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE))
  11. $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE))
  12. $(info - LED_ANIMATION = $(LED_ANIMATIONS))
  13. $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE))
  14. $(info )
  15. endef
  16. ifneq ($(strip $(HELIX)),)
  17. ### Helix keyboard keymap: convenient command line option
  18. ## make HELIX=<options> helix/pico:<keymap>
  19. ## option= oled | back | under | no_ani | na | ios | verbose
  20. ## ex.
  21. ## make HELIX=oled helix/pico:<keymap>
  22. ## make HELIX=oled,back helix/pico:<keymap>
  23. ## make HELIX=oled,under helix/pico:<keymap>
  24. ## make HELIX=oled,back,na helix/pico:<keymap>
  25. ## make HELIX=oled,back,ios helix/pico:<keymap>
  26. ##
  27. ifeq ($(findstring oled,$(HELIX)), oled)
  28. OLED_ENABLE = yes
  29. endif
  30. ifeq ($(findstring back,$(HELIX)), back)
  31. LED_BACK_ENABLE = yes
  32. else ifeq ($(findstring under,$(HELIX)), under)
  33. LED_UNDERGLOW_ENABLE = yes
  34. endif
  35. ifeq ($(findstring na,$(HELIX)), na)
  36. LED_ANIMATIONS = no
  37. endif
  38. ifeq ($(findstring no_ani,$(HELIX)), no_ani)
  39. LED_ANIMATIONS = no
  40. endif
  41. ifeq ($(findstring ios,$(HELIX)), ios)
  42. IOS_DEVICE_ENABLE = yes
  43. endif
  44. ifeq ($(findstring verbose,$(HELIX)), verbose)
  45. SHOW_VERBOSE_INFO = yes
  46. endif
  47. SHOW_HELIX_OPTIONS = yes
  48. endif
  49. ########
  50. # convert Helix-specific options (that represent combinations of standard options)
  51. # into QMK standard options.
  52. ifeq ($(strip $(LED_BACK_ENABLE)), yes)
  53. RGBLIGHT_ENABLE = yes
  54. OPT_DEFS += -DRGBLED_BACK
  55. ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  56. $(eval $(call HELIX_CUSTOMISE_MSG))
  57. $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
  58. endif
  59. else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  60. RGBLIGHT_ENABLE = yes
  61. endif
  62. ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
  63. OPT_DEFS += -DIOS_DEVICE_ENABLE
  64. endif
  65. ifeq ($(strip $(LED_ANIMATIONS)), yes)
  66. OPT_DEFS += -DLED_ANIMATIONS
  67. endif
  68. ifeq ($(strip $(OLED_ENABLE)), yes)
  69. OPT_DEFS += -DOLED_ENABLE
  70. endif
  71. ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
  72. OPT_DEFS += -DLOCAL_GLCDFONT
  73. endif
  74. ifeq ($(strip $(AUDIO_ENABLE)),yes)
  75. ifeq ($(strip $(RGBLIGHT_ENABLE)),yes)
  76. LINK_TIME_OPTIMIZATION_ENABLE = yes
  77. endif
  78. ifeq ($(strip $(OLED_ENABLE)),yes)
  79. LINK_TIME_OPTIMIZATION_ENABLE = yes
  80. endif
  81. endif
  82. ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
  83. $(eval $(call HELIX_CUSTOMISE_MSG))
  84. ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
  85. $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
  86. $(info -- OPT_DEFS = $(OPT_DEFS))
  87. $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE))
  88. $(info )
  89. endif
  90. endif