local_features.mk 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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:<keymap>
  19. ## option= oled | back | under | na | ios
  20. ## ex.
  21. ## make HELIX=oled helix:<keymap>
  22. ## make HELIX=oled,back helix:<keymap>
  23. ## make HELIX=oled,under helix:<keymap>
  24. ## make HELIX=oled,back,na helix:<keymap>
  25. ## make HELIX=oled,back,ios helix:<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. ifneq ($(strip $(HELIX_ROWS)), 4)
  53. ifneq ($(strip $(HELIX_ROWS)), 5)
  54. $(error HELIX_ROWS = $(strip $(HELIX_ROWS)) is unexpected value)
  55. endif
  56. endif
  57. OPT_DEFS += -DHELIX_ROWS=$(strip $(HELIX_ROWS))
  58. ifeq ($(strip $(LED_BACK_ENABLE)), yes)
  59. RGBLIGHT_ENABLE = yes
  60. OPT_DEFS += -DRGBLED_BACK
  61. ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  62. $(eval $(call HELIX_CUSTOMISE_MSG))
  63. $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
  64. endif
  65. else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
  66. RGBLIGHT_ENABLE = yes
  67. endif
  68. ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
  69. OPT_DEFS += -DIOS_DEVICE_ENABLE
  70. endif
  71. ifeq ($(strip $(LED_ANIMATIONS)), yes)
  72. OPT_DEFS += -DLED_ANIMATIONS
  73. endif
  74. ifeq ($(strip $(OLED_ENABLE)), yes)
  75. OPT_DEFS += -DOLED_ENABLE
  76. endif
  77. ifeq ($(strip $(LOCAL_GLCDFONT)), yes)
  78. OPT_DEFS += -DLOCAL_GLCDFONT
  79. endif
  80. ifneq ($(strip $(SHOW_HELIX_OPTIONS)),)
  81. $(eval $(call HELIX_CUSTOMISE_MSG))
  82. ifneq ($(strip $(SHOW_VERBOSE_INFO)),)
  83. $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE))
  84. $(info -- OPT_DEFS = $(OPT_DEFS))
  85. $(info -- LINK_TIME_OPTIMIZATION_ENABLE = $(LINK_TIME_OPTIMIZATION_ENABLE))
  86. $(info )
  87. endif
  88. endif