[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1510568979-24440-6-git-send-email-yamada.masahiro@socionext.com>
Date: Mon, 13 Nov 2017 19:29:38 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-kbuild@...r.kernel.org
Cc: Douglas Anderson <dianders@...omium.org>,
Sam Ravnborg <sam@...nborg.org>,
Michal Marek <michal.lkml@...kovi.net>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <mmarek@...e.com>, linux-kernel@...r.kernel.org
Subject: [PATCH v2 5/6] 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@...ionext.com>
---
Changes in v2:
- Remove "." from the filter-out list
scripts/Makefile.build | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 496ecd8..8624924 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -583,8 +583,13 @@ endif
ifneq ($(KBUILD_SRC),)
# Create directories for object files if they do not exist
obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
+# If cmd_files exist, their directories apparently exist. Skip mkdir.
+exist-dirs := $(sort $(patsubst %/,%, $(dir $(cmd_files))))
+obj-dirs := $(strip $(filter-out $(exist-dirs), $(obj-dirs)))
+ifneq ($(obj-dirs),)
$(shell mkdir -p $(obj-dirs))
endif
+endif
# Declare the contents of the .PHONY variable as phony. We keep that
# information in a variable se we can use it in if_changed and friends.
--
2.7.4
Powered by blists - more mailing lists