All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories
@ 2019-10-16  5:15 Masahiro Yamada
  2019-10-16  5:15 ` [PATCH 2/2] kbuild: make target builds much faster Masahiro Yamada
  2019-10-24 17:20 ` [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-10-16  5:15 UTC (permalink / raw
  To: linux-kbuild; +Cc: Julia Lawall, Masahiro Yamada, Michal Marek, linux-kernel

KBUILD_SINGLE_TARGETS does not need to contain all the targets.
Change it to keep track the targets only from the current directory
and its subdirectories.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index a9e47953ca53..dcbb0124dac4 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -469,15 +469,15 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
 
 ifdef single-build
 
+KBUILD_SINGLE_TARGETS := $(filter $(obj)/%, $(KBUILD_SINGLE_TARGETS))
+
 curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \
 			$(if $(filter $(x) $(basename $(x)).o, $(targets)), $(x))))
 
 # Handle single targets without any rule: show "Nothing to be done for ..." or
 # "No rule to make target ..." depending on whether the target exists.
 unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \
-			$(filter $(obj)/%, \
-				$(filter-out $(curdir-single), \
-					$(KBUILD_SINGLE_TARGETS))))
+			$(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS)))
 
 __build: $(curdir-single) $(subdir-ym)
 ifneq ($(unknown-single),)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] kbuild: make target builds much faster
  2019-10-16  5:15 [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada
@ 2019-10-16  5:15 ` Masahiro Yamada
  2019-10-24 17:20 ` [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-10-16  5:15 UTC (permalink / raw
  To: linux-kbuild; +Cc: Julia Lawall, Masahiro Yamada, Michal Marek, linux-kernel

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.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index dcbb0124dac4..7eabbb66a65c 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -479,7 +479,10 @@ curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \
 unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \
 			$(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS)))
 
-__build: $(curdir-single) $(subdir-ym)
+single-subdirs := $(foreach d, $(subdir-ym), \
+			$(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d)))
+
+__build: $(curdir-single) $(single-subdirs)
 ifneq ($(unknown-single),)
 	$(Q)$(MAKE) -f /dev/null $(unknown-single)
 endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories
  2019-10-16  5:15 [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada
  2019-10-16  5:15 ` [PATCH 2/2] kbuild: make target builds much faster Masahiro Yamada
@ 2019-10-24 17:20 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-10-24 17:20 UTC (permalink / raw
  To: Linux Kbuild mailing list
  Cc: Julia Lawall, Michal Marek, Linux Kernel Mailing List

On Wed, Oct 16, 2019 at 2:17 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> KBUILD_SINGLE_TARGETS does not need to contain all the targets.
> Change it to keep track the targets only from the current directory
> and its subdirectories.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Series, applied to linux-kbuild.


>
>  scripts/Makefile.build | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index a9e47953ca53..dcbb0124dac4 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -469,15 +469,15 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \
>
>  ifdef single-build
>
> +KBUILD_SINGLE_TARGETS := $(filter $(obj)/%, $(KBUILD_SINGLE_TARGETS))
> +
>  curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \
>                         $(if $(filter $(x) $(basename $(x)).o, $(targets)), $(x))))
>
>  # Handle single targets without any rule: show "Nothing to be done for ..." or
>  # "No rule to make target ..." depending on whether the target exists.
>  unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \
> -                       $(filter $(obj)/%, \
> -                               $(filter-out $(curdir-single), \
> -                                       $(KBUILD_SINGLE_TARGETS))))
> +                       $(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS)))
>
>  __build: $(curdir-single) $(subdir-ym)
>  ifneq ($(unknown-single),)
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-24 17:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-16  5:15 [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada
2019-10-16  5:15 ` [PATCH 2/2] kbuild: make target builds much faster Masahiro Yamada
2019-10-24 17:20 ` [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.