aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-11-13 05:29:38 -0500
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-11-15 19:07:36 -0500
commitc4da7ed0e7d715b159b11efd10408510ffed1aa3 (patch)
treea08d8a1e2fcb39de48dd815d0bf30996b8bbb2f7
parent8a78756eb545a6fb8007fa154a626ca2bc208027 (diff)
kbuild: optimize object directory creation for incremental build
The previous commit largely optimized the object directory creation. We can optimize it more for incremental build. There are already *.cmd files in the output directory. The existing *.cmd files have been picked up by $(wildcard ...). Obviously, directories containing them exist too, so we can skip "mkdir -p". With this, Kbuild runs almost zero "mkdir -p" in incremental building. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r--scripts/Makefile.build5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 496ecd825c71..8624924a2991 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -583,8 +583,13 @@ endif
583ifneq ($(KBUILD_SRC),) 583ifneq ($(KBUILD_SRC),)
584# Create directories for object files if they do not exist 584# Create directories for object files if they do not exist
585obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) 585obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
586# If cmd_files exist, their directories apparently exist. Skip mkdir.
587exist-dirs := $(sort $(patsubst %/,%, $(dir $(cmd_files))))
588obj-dirs := $(strip $(filter-out $(exist-dirs), $(obj-dirs)))
589ifneq ($(obj-dirs),)
586$(shell mkdir -p $(obj-dirs)) 590$(shell mkdir -p $(obj-dirs))
587endif 591endif
592endif
588 593
589# Declare the contents of the .PHONY variable as phony. We keep that 594# Declare the contents of the .PHONY variable as phony. We keep that
590# information in a variable se we can use it in if_changed and friends. 595# information in a variable se we can use it in if_changed and friends.