From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
<linux-kbuild@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
Sam Ravnborg <sam@ravnborg.org>,
Douglas Anderson <dianders@chromium.org>,
Michal Marek <mmarek@suse.com>
Subject: Re: [PATCH 4/4] kbuild: optimize object directory creation for incremental build
Date: Fri, 10 Nov 2017 18:58:26 +0800 [thread overview]
Message-ID: <83744f82-8800-7c67-df58-e8925c8d50a3@cn.fujitsu.com> (raw)
In-Reply-To: <1510242077-8122-5-git-send-email-yamada.masahiro@socionext.com>
Masahiro-san
On 11/09/2017 11:41 PM, Masahiro Yamada wrote:
> 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>
> ---
>
> scripts/Makefile.build | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 89ac180..90ea7a5 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -583,8 +583,13 @@ endif
> ifneq ($(KBUILD_SRC),)
> # Create directories for object files if directory does 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)))
First I am not sure if the dot "." here is necessary, because I guess
kbuild always descend into subdir do recursive make, so, very
$(cmd_files) should have at least 1 level dir.
Second, Assuming that "." probably exists, would it be "./"? because it
is what "dir" function returns.
--
Sincerely,
Cao jin
> +ifneq ($(obj-dirs),)
> $(shell mkdir -p $(obj-dirs))
> endif
> +endif
>
next prev parent reply other threads:[~2017-11-10 10:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 15:41 [PATCH 0/4] kbuild: optimize output directory creation Masahiro Yamada
2017-11-09 15:41 ` [PATCH 1/4] kbuild: create directory for make cache only when necessary Masahiro Yamada
2017-11-09 17:59 ` Doug Anderson
2017-11-10 4:12 ` Masahiro Yamada
2017-11-10 17:34 ` Doug Anderson
2017-11-09 15:41 ` [PATCH 2/4] kbuild: remove redundant $(wildcard ...) for cmd_files calculation Masahiro Yamada
2017-11-10 4:53 ` Doug Anderson
2017-11-10 4:55 ` Masahiro Yamada
2017-11-09 15:41 ` [PATCH 3/4] kbuild: create object directories simpler and faster Masahiro Yamada
2017-11-10 6:26 ` Ingo Molnar
2017-11-10 8:45 ` Cao jin
2017-11-10 9:21 ` Masahiro Yamada
2017-11-13 8:48 ` Masahiro Yamada
2017-11-10 18:46 ` Doug Anderson
2017-11-09 15:41 ` [PATCH 4/4] kbuild: optimize object directory creation for incremental build Masahiro Yamada
2017-11-10 10:58 ` Cao jin [this message]
2017-11-13 7:24 ` Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83744f82-8800-7c67-df58-e8925c8d50a3@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=dianders@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mmarek@suse.com \
--cc=sam@ravnborg.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®