From b8c68afb2f46fba3bae2a0cb6fdef867f95353a8 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Tue, 31 Aug 2021 16:58:07 +0900 Subject: [Keyboard] Helix use `post_rules.mk` (#14216) * Helix/pico use post_rules.mk insted of local_features.mk Tested with the following procedure. ``` git checkout 77a93fec79 (qmk/develop) make clean make helix/pico:all:check-md5 make helix/pico/sc:all:check-md5 git checkout helix_use_post_rules.mk make clean make helix/pico:all:check-md5 make helix/pico/sc:all:check-md5 ``` * Helix/rev2 use post_rules.mk Tested with the following procedure. ``` git checkout 77a93fec79 (qmk/develop) make clean make helix/pico:all:check-md5 make helix/pico/sc:all:check-md5 make helix/rev2:all:check-md5 make helix/rev2/sc:all:check-md5 git checkout helix_use_post_rules.mk make clean make helix/pico:all:check-md5 make helix/pico/sc:all:check-md5 make helix/rev2:all:check-md5 make helix/rev2/sc:all:check-md5 ``` --- keyboards/helix/pico/keymaps/biacco/rules.mk | 4 - keyboards/helix/pico/keymaps/default/rules.mk | 4 - keyboards/helix/pico/keymaps/mtei/rules.mk | 4 - keyboards/helix/pico/local_features.mk | 149 --------------------- keyboards/helix/pico/post_rules.mk | 147 ++++++++++++++++++++ keyboards/helix/pico/rules.mk | 2 - keyboards/helix/rev2/keymaps/default/rules.mk | 4 - keyboards/helix/rev2/keymaps/five_rows/rules.mk | 4 - .../helix/rev2/keymaps/five_rows_jis/rules.mk | 4 - keyboards/helix/rev2/keymaps/fraanrosi/rules.mk | 4 - keyboards/helix/rev2/keymaps/froggy/rules.mk | 4 - keyboards/helix/rev2/keymaps/froggy_106/rules.mk | 4 - keyboards/helix/rev2/keymaps/led_test/rules.mk | 4 - keyboards/helix/rev2/keymaps/yshrsmz/rules.mk | 4 - keyboards/helix/rev2/post_rules.mk | 3 + 15 files changed, 150 insertions(+), 195 deletions(-) delete mode 100644 keyboards/helix/pico/local_features.mk create mode 100644 keyboards/helix/pico/post_rules.mk create mode 100644 keyboards/helix/rev2/post_rules.mk diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk index 37e49977c5..993ade2673 100644 --- a/keyboards/helix/pico/keymaps/biacco/rules.mk +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -18,7 +18,3 @@ LTO_ENABLE = no # if firmware size over limit, try this option # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = no # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index 8f198e3803..8977897f9b 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -18,7 +18,3 @@ LTO_ENABLE = no # if firmware size over limit, try this option # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/keymaps/mtei/rules.mk b/keyboards/helix/pico/keymaps/mtei/rules.mk index 165233f5fe..05a60f67d5 100644 --- a/keyboards/helix/pico/keymaps/mtei/rules.mk +++ b/keyboards/helix/pico/keymaps/mtei/rules.mk @@ -18,7 +18,3 @@ LTO_ENABLE = no # if firmware size over limit, try this option # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/pico/local_features.mk b/keyboards/helix/pico/local_features.mk deleted file mode 100644 index be5c739f97..0000000000 --- a/keyboards/helix/pico/local_features.mk +++ /dev/null @@ -1,149 +0,0 @@ -# -# local_features.mk contains post-processing rules for the Helix keyboard. -# -# Post-processing rules convert keyboard-specific shortcuts (that represent -# combinations of standard options) into QMK standard options. -# - -KEYBOARD_LOCAL_FEATURES_MK := - -define HELIX_CUSTOMISE_MSG - $(info Helix Spacific Build Options) - $(info - OLED_ENABLE = $(OLED_ENABLE)) - $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) - $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) - $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) - $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) - $(info ) -endef - -define HELIX_HELP_MSG - $(info Helix keyboard convenient command line option) - $(info - make HELIX= helix/pico:) - $(info - option= oled | back | under | na | no-ani) - $(info - ios | sc | split-common | scan | verbose) - $(info - ex.) - $(info - make HELIX=oled helix/pico:) - $(info - make HELIX=back helix/pico:) - $(info - make HELIX=under helix/pico:) - $(info - make HELIX=back,na helix/pico:) - $(info - make HELIX=back,ios helix/pico:) - $(info ) -endef - - ifneq ($(strip $(HELIX)),) - COMMA=, - helix_option := $(subst $(COMMA), , $(HELIX)) - ifneq ($(filter help,$(helix_option)),) - $(eval $(call HELIX_HELP_MSG)) - $(error ) - endif - ifneq ($(filter oled,$(helix_option)),) - OLED_ENABLE = yes - endif - ifneq ($(filter back,$(helix_option)),) - LED_BACK_ENABLE = yes - else ifneq ($(filter under,$(helix_option)),) - LED_UNDERGLOW_ENABLE = yes - endif - ifneq ($(filter na,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no_ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter no-ani,$(helix_option)),) - LED_ANIMATIONS = no - endif - ifneq ($(filter ios,$(helix_option)),) - IOS_DEVICE_ENABLE = yes - endif - ifneq ($(filter sc,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter split-common,$(helix_option)),) - SPLIT_KEYBOARD = yes - endif - ifneq ($(filter scan,$(helix_option)),) - # use DEBUG_MATRIX_SCAN_RATE - # see docs/newbs_testing_debugging.md - OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE - CONSOLE_ENABLE = yes - SHOW_VERBOSE_INFO = yes - endif - ifneq ($(filter verbose,$(helix_option)),) - SHOW_VERBOSE_INFO = yes - endif - SHOW_HELIX_OPTIONS = yes - endif - -ifneq ($(strip $(SPLIT_KEYBOARD)), yes) - SRC += local_drivers/serial.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - - # A workaround until #7089 is merged. - # serial.c must not be compiled with the -lto option. - # The current LIB_SRC has a side effect with the -fno-lto option, so use it. - LIB_SRC += local_drivers/serial.c - - CUSTOM_MATRIX = yes - - SRC += pico/matrix.c - SRC += pico/split_util.c -endif - -######## -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. - -ifeq ($(strip $(LED_BACK_ENABLE)), yes) - RGBLIGHT_ENABLE = yes - OPT_DEFS += -DRGBLED_BACK - ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - $(eval $(call HELIX_CUSTOMISE_MSG)) - $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') - endif -else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) - RGBLIGHT_ENABLE = yes -endif - -ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) - OPT_DEFS += -DIOS_DEVICE_ENABLE -endif - -ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DLED_ANIMATIONS -endif - -ifeq ($(strip $(OLED_ENABLE)), yes) - SRC += local_drivers/i2c.c - SRC += local_drivers/ssd1306.c - KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers - OPT_DEFS += -DOLED_ENABLE - ifeq ($(strip $(LOCAL_GLCDFONT)), yes) - OPT_DEFS += -DLOCAL_GLCDFONT - endif -endif - -ifeq ($(strip $(AUDIO_ENABLE)),yes) - ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) - LTO_ENABLE = yes - endif - ifeq ($(strip $(OLED_ENABLE)),yes) - LTO_ENABLE = yes - endif -endif - -ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) - $(eval $(call HELIX_CUSTOMISE_MSG)) - ifneq ($(strip $(SHOW_VERBOSE_INFO)),) - $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) - $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) - $(info -- OPT_DEFS = $(OPT_DEFS)) - $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) - $(info -- LTO_ENABLE = $(LTO_ENABLE)) - $(info ) - endif -endif - -OLED_ENABLE = no # disable OLED in TOP/common_features.mk diff --git a/keyboards/helix/pico/post_rules.mk b/keyboards/helix/pico/post_rules.mk new file mode 100644 index 0000000000..38573d75a5 --- /dev/null +++ b/keyboards/helix/pico/post_rules.mk @@ -0,0 +1,147 @@ +# +# post_rules.mk contains post-processing rules for the Helix keyboard. +# +# Post-processing rules convert keyboard-specific shortcuts (that represent +# combinations of standard options) into QMK standard options. +# + +define HELIX_CUSTOMISE_MSG + $(info Helix Spacific Build Options) + $(info - OLED_ENABLE = $(OLED_ENABLE)) + $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) + $(info ) +endef + +define HELIX_HELP_MSG + $(info Helix keyboard convenient command line option) + $(info - make HELIX= helix/pico:) + $(info - option= oled | back | under | na | no-ani) + $(info - ios | sc | split-common | scan | verbose) + $(info - ex.) + $(info - make HELIX=oled helix/pico:) + $(info - make HELIX=back helix/pico:) + $(info - make HELIX=under helix/pico:) + $(info - make HELIX=back,na helix/pico:) + $(info - make HELIX=back,ios helix/pico:) + $(info ) +endef + + ifneq ($(strip $(HELIX)),) + COMMA=, + helix_option := $(subst $(COMMA), , $(HELIX)) + ifneq ($(filter help,$(helix_option)),) + $(eval $(call HELIX_HELP_MSG)) + $(error ) + endif + ifneq ($(filter oled,$(helix_option)),) + OLED_ENABLE = yes + endif + ifneq ($(filter back,$(helix_option)),) + LED_BACK_ENABLE = yes + else ifneq ($(filter under,$(helix_option)),) + LED_UNDERGLOW_ENABLE = yes + endif + ifneq ($(filter na,$(helix_option)),) + LED_ANIMATIONS = no + endif + ifneq ($(filter no_ani,$(helix_option)),) + LED_ANIMATIONS = no + endif + ifneq ($(filter no-ani,$(helix_option)),) + LED_ANIMATIONS = no + endif + ifneq ($(filter ios,$(helix_option)),) + IOS_DEVICE_ENABLE = yes + endif + ifneq ($(filter sc,$(helix_option)),) + SPLIT_KEYBOARD = yes + endif + ifneq ($(filter split-common,$(helix_option)),) + SPLIT_KEYBOARD = yes + endif + ifneq ($(filter scan,$(helix_option)),) + # use DEBUG_MATRIX_SCAN_RATE + # see docs/newbs_testing_debugging.md + OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE + CONSOLE_ENABLE = yes + SHOW_VERBOSE_INFO = yes + endif + ifneq ($(filter verbose,$(helix_option)),) + SHOW_VERBOSE_INFO = yes + endif + SHOW_HELIX_OPTIONS = yes + endif + +ifneq ($(strip $(SPLIT_KEYBOARD)), yes) + SRC += local_drivers/serial.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers + + # A workaround until #7089 is merged. + # serial.c must not be compiled with the -lto option. + # The current LIB_SRC has a side effect with the -fno-lto option, so use it. + LIB_SRC += local_drivers/serial.c + + CUSTOM_MATRIX = yes + + SRC += pico/matrix.c + SRC += pico/split_util.c +endif + +######## +# convert Helix-specific options (that represent combinations of standard options) +# into QMK standard options. + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + SRC += local_drivers/i2c.c + SRC += local_drivers/ssd1306.c + KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers + OPT_DEFS += -DOLED_ENABLE + ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT + endif +endif + +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + LTO_ENABLE = yes + endif + ifeq ($(strip $(OLED_ENABLE)),yes) + LTO_ENABLE = yes + endif +endif + +ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) + $(eval $(call HELIX_CUSTOMISE_MSG)) + ifneq ($(strip $(SHOW_VERBOSE_INFO)),) + $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) + $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) + $(info -- OPT_DEFS = $(OPT_DEFS)) + $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) + $(info -- LTO_ENABLE = $(LTO_ENABLE)) + $(info ) + endif +endif + +OLED_ENABLE = no # disable OLED in TOP/common_features.mk diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index cb9a70e00e..12caec37ef 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,5 +1,3 @@ -KEYBOARD_LOCAL_FEATURES_MK := $(dir $(lastword $(MAKEFILE_LIST)))local_features.mk - # Helix Spacific Build Options default values OLED_ENABLE = no # OLED_ENABLE LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index c16f3e2b87..58b43a6bda 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -29,7 +29,3 @@ OLED_SELECT = core ifeq ($(strip $(OLED_ENABLE)), yes) SRC += oled_display.c endif - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index e59ce73326..5f7e4668fc 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -95,7 +95,3 @@ endif ifeq ($(strip $(OLED_ENABLE)), yes) SRC += oled_display.c endif - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index d44382f86a..7c4a7b6045 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -17,7 +17,3 @@ HELIX_ROWS = 5 # Helix Rows is 4 or 5 # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) # LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk b/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk index 462a83f6e7..98585b0d60 100644 --- a/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk +++ b/keyboards/helix/rev2/keymaps/fraanrosi/rules.mk @@ -22,7 +22,3 @@ LED_ANIMATIONS = yes # LED animations LED_BACK_ENABLE = no LED_UNDERGLOW_ENABLE = yes - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index 5a0fd9a2b1..2d01c43fe7 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -17,7 +17,3 @@ LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/froggy_106/rules.mk b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk index 5a0fd9a2b1..2d01c43fe7 100644 --- a/keyboards/helix/rev2/keymaps/froggy_106/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk @@ -17,7 +17,3 @@ LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index 8b590eee86..3ab27acfc2 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -23,7 +23,3 @@ ifeq ($(strip $(OLED_ENABLE)), yes) SRC += oled_display.c endif SRC += led_test_init.c - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk index 83dcc9b3b8..cd436cd9a3 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk +++ b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk @@ -17,7 +17,3 @@ OLED_ENABLE = yes # OLED_ENABLE # LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = no # LED animations # IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) - -# convert Helix-specific options (that represent combinations of standard options) -# into QMK standard options. -include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) diff --git a/keyboards/helix/rev2/post_rules.mk b/keyboards/helix/rev2/post_rules.mk new file mode 100644 index 0000000000..4c671d4515 --- /dev/null +++ b/keyboards/helix/rev2/post_rules.mk @@ -0,0 +1,3 @@ +ifneq ($(strip $(KEYBOARD_LOCAL_FEATURES_MK)),) + include $(strip $(KEYBOARD_LOCAL_FEATURES_MK)) +endif -- cgit v1.2.3