diff options
Diffstat (limited to 'keyboards/helix/pico/post_rules.mk')
-rw-r--r-- | keyboards/helix/pico/post_rules.mk | 138 |
1 files changed, 34 insertions, 104 deletions
diff --git a/keyboards/helix/pico/post_rules.mk b/keyboards/helix/pico/post_rules.mk index 38573d75a..88bb5482b 100644 --- a/keyboards/helix/pico/post_rules.mk +++ b/keyboards/helix/pico/post_rules.mk | |||
@@ -4,90 +4,30 @@ | |||
4 | # Post-processing rules convert keyboard-specific shortcuts (that represent | 4 | # Post-processing rules convert keyboard-specific shortcuts (that represent |
5 | # combinations of standard options) into QMK standard options. | 5 | # combinations of standard options) into QMK standard options. |
6 | # | 6 | # |
7 | -include $(strip $(HELIX_TOP_DIR)/pico/override_helix_options.mk) ## File dedicated to maintenance | ||
7 | 8 | ||
8 | define HELIX_CUSTOMISE_MSG | 9 | # Parse 'HELIX=xx,yy,zz' option |
9 | $(info Helix Spacific Build Options) | 10 | ifneq ($(strip $(HELIX)),) |
10 | $(info - OLED_ENABLE = $(OLED_ENABLE)) | 11 | # make HELIX=ios helix/pico:AKEYMAP |
11 | $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) | 12 | # make HELIX=no-ani helix/pico:AKEYMAP |
12 | $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) | 13 | # make HELIX=ios,no-ani helix/pico:AKEYMAP |
13 | $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) | 14 | define HELIX_OPTION_PARSE |
14 | $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) | 15 | # parce 'no-ani' 'ios' |
15 | $(info ) | 16 | $(if $(SHOW_PARCE),$(info parse .$1.)) #debug |
16 | endef | 17 | $(if $(HELIX_OVERRIDE_PARSE),$(call HELIX_OVERRIDE_PARSE,$1)) |
17 | 18 | ||
18 | define HELIX_HELP_MSG | 19 | ifeq ($(strip $1),ios) |
19 | $(info Helix keyboard convenient command line option) | 20 | IOS_DEVICE_ENABLE = yes |
20 | $(info - make HELIX=<options> helix/pico:<keymap>) | 21 | endif |
21 | $(info - option= oled | back | under | na | no-ani) | 22 | ifneq ($(filter na no_ani no-ani,$(strip $1)),) |
22 | $(info - ios | sc | split-common | scan | verbose) | 23 | LED_ANIMATIONS = no |
23 | $(info - ex.) | 24 | endif |
24 | $(info - make HELIX=oled helix/pico:<keymap>) | 25 | endef # end of HELIX_OPTION_PARSE |
25 | $(info - make HELIX=back helix/pico:<keymap>) | ||
26 | $(info - make HELIX=under helix/pico:<keymap>) | ||
27 | $(info - make HELIX=back,na helix/pico:<keymap>) | ||
28 | $(info - make HELIX=back,ios helix/pico:<keymap>) | ||
29 | $(info ) | ||
30 | endef | ||
31 | 26 | ||
32 | ifneq ($(strip $(HELIX)),) | ||
33 | COMMA=, | 27 | COMMA=, |
34 | helix_option := $(subst $(COMMA), , $(HELIX)) | 28 | $(eval $(foreach A_OPTION_NAME,$(subst $(COMMA), ,$(HELIX)), \ |
35 | ifneq ($(filter help,$(helix_option)),) | 29 | $(call HELIX_OPTION_PARSE,$(A_OPTION_NAME)))) |
36 | $(eval $(call HELIX_HELP_MSG)) | ||
37 | $(error ) | ||
38 | endif | ||
39 | ifneq ($(filter oled,$(helix_option)),) | ||
40 | OLED_ENABLE = yes | ||
41 | endif | ||
42 | ifneq ($(filter back,$(helix_option)),) | ||
43 | LED_BACK_ENABLE = yes | ||
44 | else ifneq ($(filter under,$(helix_option)),) | ||
45 | LED_UNDERGLOW_ENABLE = yes | ||
46 | endif | ||
47 | ifneq ($(filter na,$(helix_option)),) | ||
48 | LED_ANIMATIONS = no | ||
49 | endif | ||
50 | ifneq ($(filter no_ani,$(helix_option)),) | ||
51 | LED_ANIMATIONS = no | ||
52 | endif | ||
53 | ifneq ($(filter no-ani,$(helix_option)),) | ||
54 | LED_ANIMATIONS = no | ||
55 | endif | ||
56 | ifneq ($(filter ios,$(helix_option)),) | ||
57 | IOS_DEVICE_ENABLE = yes | ||
58 | endif | ||
59 | ifneq ($(filter sc,$(helix_option)),) | ||
60 | SPLIT_KEYBOARD = yes | ||
61 | endif | ||
62 | ifneq ($(filter split-common,$(helix_option)),) | ||
63 | SPLIT_KEYBOARD = yes | ||
64 | endif | ||
65 | ifneq ($(filter scan,$(helix_option)),) | ||
66 | # use DEBUG_MATRIX_SCAN_RATE | ||
67 | # see docs/newbs_testing_debugging.md | ||
68 | OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE | ||
69 | CONSOLE_ENABLE = yes | ||
70 | SHOW_VERBOSE_INFO = yes | ||
71 | endif | ||
72 | ifneq ($(filter verbose,$(helix_option)),) | ||
73 | SHOW_VERBOSE_INFO = yes | ||
74 | endif | ||
75 | SHOW_HELIX_OPTIONS = yes | 30 | SHOW_HELIX_OPTIONS = yes |
76 | endif | ||
77 | |||
78 | ifneq ($(strip $(SPLIT_KEYBOARD)), yes) | ||
79 | SRC += local_drivers/serial.c | ||
80 | KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers | ||
81 | |||
82 | # A workaround until #7089 is merged. | ||
83 | # serial.c must not be compiled with the -lto option. | ||
84 | # The current LIB_SRC has a side effect with the -fno-lto option, so use it. | ||
85 | LIB_SRC += local_drivers/serial.c | ||
86 | |||
87 | CUSTOM_MATRIX = yes | ||
88 | |||
89 | SRC += pico/matrix.c | ||
90 | SRC += pico/split_util.c | ||
91 | endif | 31 | endif |
92 | 32 | ||
93 | ######## | 33 | ######## |
@@ -98,7 +38,6 @@ ifeq ($(strip $(LED_BACK_ENABLE)), yes) | |||
98 | RGBLIGHT_ENABLE = yes | 38 | RGBLIGHT_ENABLE = yes |
99 | OPT_DEFS += -DRGBLED_BACK | 39 | OPT_DEFS += -DRGBLED_BACK |
100 | ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) | 40 | ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) |
101 | $(eval $(call HELIX_CUSTOMISE_MSG)) | ||
102 | $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') | 41 | $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') |
103 | endif | 42 | endif |
104 | else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) | 43 | else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) |
@@ -113,35 +52,26 @@ ifeq ($(strip $(LED_ANIMATIONS)), yes) | |||
113 | OPT_DEFS += -DLED_ANIMATIONS | 52 | OPT_DEFS += -DLED_ANIMATIONS |
114 | endif | 53 | endif |
115 | 54 | ||
116 | ifeq ($(strip $(OLED_ENABLE)), yes) | ||
117 | SRC += local_drivers/i2c.c | ||
118 | SRC += local_drivers/ssd1306.c | ||
119 | KEYBOARD_PATHS += $(HELIX_TOP_DIR)/local_drivers | ||
120 | OPT_DEFS += -DOLED_ENABLE | ||
121 | ifeq ($(strip $(LOCAL_GLCDFONT)), yes) | ||
122 | OPT_DEFS += -DLOCAL_GLCDFONT | ||
123 | endif | ||
124 | endif | ||
125 | |||
126 | ifeq ($(strip $(AUDIO_ENABLE)),yes) | 55 | ifeq ($(strip $(AUDIO_ENABLE)),yes) |
127 | ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) | 56 | ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) |
128 | LTO_ENABLE = yes | 57 | LTO_ENABLE = yes |
129 | endif | 58 | endif |
130 | ifeq ($(strip $(OLED_ENABLE)),yes) | ||
131 | LTO_ENABLE = yes | ||
132 | endif | ||
133 | endif | 59 | endif |
134 | 60 | ||
135 | ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) | 61 | ifneq ($(strip $(SHOW_HELIX_OPTIONS)),) |
136 | $(eval $(call HELIX_CUSTOMISE_MSG)) | 62 | $(info Helix Spacific Build Options) |
137 | ifneq ($(strip $(SHOW_VERBOSE_INFO)),) | 63 | $(info - LED_BACK_ENABLE = $(LED_BACK_ENABLE)) |
138 | $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) | 64 | $(info - LED_UNDERGLOW_ENABLE = $(LED_UNDERGLOW_ENABLE)) |
139 | $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) | 65 | $(info - LED_ANIMATIONS = $(LED_ANIMATIONS)) |
140 | $(info -- OPT_DEFS = $(OPT_DEFS)) | 66 | $(info - IOS_DEVICE_ENABLE = $(IOS_DEVICE_ENABLE)) |
141 | $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) | 67 | $(info ) |
142 | $(info -- LTO_ENABLE = $(LTO_ENABLE)) | 68 | $(info QMK Build Options) |
143 | $(info ) | 69 | $(info -- SPLIT_KEYBOARD = $(SPLIT_KEYBOARD)) |
144 | endif | 70 | $(info -- AUDIO_ENABLE = $(AUDIO_ENABLE)) |
71 | $(info -- RGBLIGHT_ENABLE = $(RGBLIGHT_ENABLE)) | ||
72 | $(info -- CONSOLE_ENABLE = $(CONSOLE_ENABLE)) | ||
73 | $(info -- OPT_DEFS = $(OPT_DEFS)) | ||
74 | $(info -- LTO_ENABLE = $(LTO_ENABLE)) | ||
75 | $(info -- DEBUG_MATRIX_SCAN_RATE_ENABLE = $(DEBUG_MATRIX_SCAN_RATE_ENABLE)) | ||
76 | $(info ) | ||
145 | endif | 77 | endif |
146 | |||
147 | OLED_ENABLE = no # disable OLED in TOP/common_features.mk | ||