History

kbuild: make single target builds much faster

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.

Masahiro Yamada committed 7 years ago

Commit 2dffd231 parent 20312621 file · +4 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/Makefile.build+4−1
@@ -479,7 +479,10 @@ curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \ · 478 unmodified lines
479479 unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \
480480 $(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS)))
481481
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)
483486 ifneq ($(unknown-single),)
484487 $(Q)$(MAKE) -f /dev/null $(unknown-single)
485488 endif