Since commit 394053f4a4b3 ("kbuild: make single targets work more correctly"), building single targets is really slow. Speed it up by not descending into unrelated directories.
Unified · Split
| @@ -479,7 +479,10 @@ curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \ · 478 unmodified lines | ||
| 479 | 479 | unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \ |
| 480 | 480 | $(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS))) |
| 481 | 481 | |
| 482 | −__build: $(curdir-single) $(subdir-ym) | |
| 482 | +single-subdirs := $(foreach d, $(subdir-ym), \ | |
| 483 | + $(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d))) | |
| 484 | + | |
| 485 | +__build: $(curdir-single) $(single-subdirs) | |
| 483 | 486 | ifneq ($(unknown-single),) |
| 484 | 487 | $(Q)$(MAKE) -f /dev/null $(unknown-single) |
| 485 | 488 | endif |