diff options
| author | Fredric Silberberg <fred@silberberg.xyz> | 2018-07-10 23:39:38 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-07-17 00:10:42 -0400 |
| commit | bbecd276d2883e488f7ec41ec78a0f71c6d604c1 (patch) | |
| tree | 8a88fb9d54968deb620a1ad6f9bce6c23b7c766b /Makefile | |
| parent | 4d4b845cf59749c4af4f91d05c39b9196b00ab99 (diff) | |
| download | qmk_firmware-bbecd276d2883e488f7ec41ec78a0f71c6d604c1.tar.gz qmk_firmware-bbecd276d2883e488f7ec41ec78a0f71c6d604c1.zip | |
Correct parsing of rules.mk for keyboard revisions
Previously, when looking for rules.mk files, we'd parse the individual
folders (A/B/C/D/E) into 5 variables, (A/B/C/D/E, A/B/C/D, A/B/C, A/B,
and A). Then, we'd get the final directory names and store _those_ in 5
new variables (A, B, C, D, and E). Then, when looking for the rules.mk,
we'd look in root_dir/keyboards/(A|B|C|D|E)/rules.mk, instead of looking
in root_dir/keyboards(A|A/B|A/B/C|A/B/C/D|A/B/C/D/E)/rules.mk. This
commit changes that logic from the former to the latter.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 29 |
1 files changed, 12 insertions, 17 deletions
| @@ -67,7 +67,7 @@ $(eval $(call NEXT_PATH_ELEMENT)) | |||
| 67 | # It's really a very simple if else chain, if you squint enough, | 67 | # It's really a very simple if else chain, if you squint enough, |
| 68 | # but the makefile syntax makes it very verbose. | 68 | # but the makefile syntax makes it very verbose. |
| 69 | # If we are in a subfolder of keyboards | 69 | # If we are in a subfolder of keyboards |
| 70 | # | 70 | # |
| 71 | # *** No longer needed ** | 71 | # *** No longer needed ** |
| 72 | # | 72 | # |
| 73 | # ifeq ($(CURRENT_PATH_ELEMENT),keyboards) | 73 | # ifeq ($(CURRENT_PATH_ELEMENT),keyboards) |
| @@ -307,11 +307,6 @@ define PARSE_KEYBOARD | |||
| 307 | KEYBOARD_FOLDER_PATH_3 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_2))) | 307 | KEYBOARD_FOLDER_PATH_3 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_2))) |
| 308 | KEYBOARD_FOLDER_PATH_4 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_3))) | 308 | KEYBOARD_FOLDER_PATH_4 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_3))) |
| 309 | KEYBOARD_FOLDER_PATH_5 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_4))) | 309 | KEYBOARD_FOLDER_PATH_5 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_4))) |
| 310 | KEYBOARD_FOLDER_1 := $$(notdir $$(KEYBOARD_FOLDER_PATH_1)) | ||
| 311 | KEYBOARD_FOLDER_2 := $$(notdir $$(KEYBOARD_FOLDER_PATH_2)) | ||
| 312 | KEYBOARD_FOLDER_3 := $$(notdir $$(KEYBOARD_FOLDER_PATH_3)) | ||
| 313 | KEYBOARD_FOLDER_4 := $$(notdir $$(KEYBOARD_FOLDER_PATH_4)) | ||
| 314 | KEYBOARD_FOLDER_5 := $$(notdir $$(KEYBOARD_FOLDER_PATH_5)) | ||
| 315 | 310 | ||
| 316 | KEYMAPS := | 311 | KEYMAPS := |
| 317 | # get a list of all keymaps | 312 | # get a list of all keymaps |
| @@ -325,35 +320,35 @@ define PARSE_KEYBOARD | |||
| 325 | $$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS))) | 320 | $$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS))) |
| 326 | 321 | ||
| 327 | KEYBOARD_LAYOUTS := | 322 | KEYBOARD_LAYOUTS := |
| 328 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk)","") | 323 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)","") |
| 329 | LAYOUTS := | 324 | LAYOUTS := |
| 330 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk) | 325 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk) |
| 331 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) | 326 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) |
| 332 | endif | 327 | endif |
| 333 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk)","") | 328 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)","") |
| 334 | LAYOUTS := | 329 | LAYOUTS := |
| 335 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk) | 330 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk) |
| 336 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) | 331 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) |
| 337 | endif | 332 | endif |
| 338 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk)","") | 333 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)","") |
| 339 | LAYOUTS := | 334 | LAYOUTS := |
| 340 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk) | 335 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk) |
| 341 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) | 336 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) |
| 342 | endif | 337 | endif |
| 343 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk)","") | 338 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)","") |
| 344 | LAYOUTS := | 339 | LAYOUTS := |
| 345 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk) | 340 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk) |
| 346 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) | 341 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) |
| 347 | endif | 342 | endif |
| 348 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk)","") | 343 | ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)","") |
| 349 | LAYOUTS := | 344 | LAYOUTS := |
| 350 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk) | 345 | $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk) |
| 351 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) | 346 | KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) |
| 352 | endif | 347 | endif |
| 353 | 348 | ||
| 354 | LAYOUT_KEYMAPS := | 349 | LAYOUT_KEYMAPS := |
| 355 | $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) | 350 | $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) |
| 356 | 351 | ||
| 357 | KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS)) | 352 | KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS)) |
| 358 | 353 | ||
| 359 | # if the rule after removing the start of it is empty (we haven't specified a kemap or target) | 354 | # if the rule after removing the start of it is empty (we haven't specified a kemap or target) |
