diff options
| author | Takeshi ISHII <2170248+mtei@users.noreply.github.com> | 2021-08-29 08:42:57 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-29 09:42:57 +1000 |
| commit | 9fe7b5307a1b520f844fd389b0cc5b67e30aa412 (patch) | |
| tree | 7255bf760f0f04b06b6bdd6c787f264ef20d6b59 /docs/hardware_keyboard_guidelines.md | |
| parent | f061ca497464fe85284906fb163a33eaee7a91ef (diff) | |
| download | qmk_firmware-9fe7b5307a1b520f844fd389b0cc5b67e30aa412.tar.gz qmk_firmware-9fe7b5307a1b520f844fd389b0cc5b67e30aa412.zip | |
add 'include keyboard_features.mk' into build_keyboard.mk (#8422)
* add 'include keyboard_features.mk' into build_keyboard.mk
keyboard_features.mk is a keyboard-local version of the functions performed by common_features.mk.
* add comment into build_keyboard.mk
* added description of keyboard_features.mk in hardware_keyboard_guidelines.md.
* rename `keyboard_features.mk` to `post_rules.mk`
Diffstat (limited to 'docs/hardware_keyboard_guidelines.md')
| -rw-r--r-- | docs/hardware_keyboard_guidelines.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/hardware_keyboard_guidelines.md b/docs/hardware_keyboard_guidelines.md index 7630b44e0..17be7ee6a 100644 --- a/docs/hardware_keyboard_guidelines.md +++ b/docs/hardware_keyboard_guidelines.md | |||
| @@ -144,10 +144,38 @@ The `rules.mk` file can also be placed in a sub-folder, and its reading order is | |||
| 144 | * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/rules.mk` | 144 | * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/rules.mk` |
| 145 | * `keyboards/top_folder/keymaps/a_keymap/rules.mk` | 145 | * `keyboards/top_folder/keymaps/a_keymap/rules.mk` |
| 146 | * `users/a_user_folder/rules.mk` | 146 | * `users/a_user_folder/rules.mk` |
| 147 | * `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/post_rules.mk` | ||
| 148 | * `keyboards/top_folder/sub_1/sub_2/sub_3/post_rules.mk` | ||
| 149 | * `keyboards/top_folder/sub_1/sub_2/post_rules.mk` | ||
| 150 | * `keyboards/top_folder/sub_1/post_rules.mk` | ||
| 151 | * `keyboards/top_folder/post_rules.mk` | ||
| 147 | * `common_features.mk` | 152 | * `common_features.mk` |
| 148 | 153 | ||
| 149 | Many of the settings written in the `rules.mk` file are interpreted by `common_features.mk`, which sets the necessary source files and compiler options. | 154 | Many of the settings written in the `rules.mk` file are interpreted by `common_features.mk`, which sets the necessary source files and compiler options. |
| 150 | 155 | ||
| 156 | The `post_rules.mk` file can interpret `features` of a keyboard-level before `common_features.mk`. For example, when your designed keyboard has the option to implement backlighting or underglow using rgblight.c, writing the following in the `post_rules.mk` makes it easier for the user to configure the `rules.mk`. | ||
| 157 | |||
| 158 | * `keyboards/top_folder/keymaps/a_keymap/rules.mk` | ||
| 159 | ```makefile | ||
| 160 | # Please set the following according to the selection of the hardware implementation option. | ||
| 161 | RGBLED_OPTION_TYPE = backlight ## none, backlight or underglow | ||
| 162 | ``` | ||
| 163 | * `keyboards/top_folder/post_rules.mk` | ||
| 164 | ```makefile | ||
| 165 | ifeq ($(filter $(strip $(RGBLED_OPTION_TYPE))x, nonex backlightx underglowx x),) | ||
| 166 | $(error unknown RGBLED_OPTION_TYPE value "$(RGBLED_OPTION_TYPE)") | ||
| 167 | endif | ||
| 168 | |||
| 169 | ifeq ($(strip $(RGBLED_OPTION_TYPE)),backlight) | ||
| 170 | RGBLIGHT_ENABLE = yes | ||
| 171 | OPT_DEFS += -DRGBLED_NUM=30 | ||
| 172 | endif | ||
| 173 | ifeq ($(strip $(RGBLED_OPTION_TYPE)),underglow) | ||
| 174 | RGBLIGHT_ENABLE = yes | ||
| 175 | OPT_DEFS += -DRGBLED_NUM=6 | ||
| 176 | endif | ||
| 177 | ``` | ||
| 178 | |||
| 151 | ?> See `build_keyboard.mk` and `common_features.mk` for more details. | 179 | ?> See `build_keyboard.mk` and `common_features.mk` for more details. |
| 152 | 180 | ||
| 153 | ### `<keyboard_name.c>` | 181 | ### `<keyboard_name.c>` |
