linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin
@ 2019-06-23 16:13 Masahiro Yamada
  2019-06-23 16:13 ` [PATCH 2/2] kbuild: split modules.order build rule out of 'modules' target Masahiro Yamada
  2019-07-06 14:45 ` [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-06-23 16:13 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

Unlike modules.order, modules.builtin is not rebuilt every time.
Once modules.builtin is created, it will not be updated until
auto.conf or tristate.conf is changed.

So, it misses to notice a change in Makefile, for example, renaming
of modules.

Kbuild must always descend into directories for modules.builtin too.

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

 Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 9514dac2660a..19c33bc69bb1 100644
--- a/Makefile
+++ b/Makefile
@@ -1289,12 +1289,16 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
 
-modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
-	$(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
+modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
 
-%/modules.builtin: include/config/auto.conf include/config/tristate.conf
-	$(Q)$(MAKE) $(modbuiltin)=$*
+modules.builtin: $(modbuiltin-dirs)
+	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
 
+PHONY += $(modbuiltin-dirs)
+# tristate.conf is not included from this Makefile. Add it as a prerequisite
+# here to make it self-healing in case somebody accidentally removes it.
+$(modbuiltin-dirs): include/config/tristate.conf
+	$(Q)$(MAKE) $(modbuiltin)=$(patsubst _modbuiltin_%,%,$@)
 
 # Target to prepare building external modules
 PHONY += modules_prepare
-- 
2.17.1


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

* [PATCH 2/2] kbuild: split modules.order build rule out of 'modules' target
  2019-06-23 16:13 [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada
@ 2019-06-23 16:13 ` Masahiro Yamada
  2019-07-06 14:45 ` [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-06-23 16:13 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, Michal Marek, linux-kernel

Merge the build rules of modules.order and modules.builtin

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

 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 19c33bc69bb1..6bfe22b852f2 100644
--- a/Makefile
+++ b/Makefile
@@ -1283,16 +1283,18 @@ all: modules
 # using awk while concatenating to the final file.
 
 PHONY += modules
-modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
-	$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
+modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin
 	@$(kecho) '  Building modules, stage 2.';
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
 
-modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
+modules.order modules.builtin:
+	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
+
+modules.order: $(vmlinux-dirs)
 
+modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
 modules.builtin: $(modbuiltin-dirs)
-	$(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
 
 PHONY += $(modbuiltin-dirs)
 # tristate.conf is not included from this Makefile. Add it as a prerequisite
-- 
2.17.1


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

* Re: [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin
  2019-06-23 16:13 [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada
  2019-06-23 16:13 ` [PATCH 2/2] kbuild: split modules.order build rule out of 'modules' target Masahiro Yamada
@ 2019-07-06 14:45 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-07-06 14:45 UTC (permalink / raw)
  To: Linux Kbuild mailing list; +Cc: Michal Marek, Linux Kernel Mailing List

On Mon, Jun 24, 2019 at 1:13 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Unlike modules.order, modules.builtin is not rebuilt every time.
> Once modules.builtin is created, it will not be updated until
> auto.conf or tristate.conf is changed.
>
> So, it misses to notice a change in Makefile, for example, renaming
> of modules.
>
> Kbuild must always descend into directories for modules.builtin too.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Both applied to linux-kbuild.

>
>  Makefile | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 9514dac2660a..19c33bc69bb1 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1289,12 +1289,16 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
>         $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
>         $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
>
> -modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
> -       $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
> +modbuiltin-dirs := $(addprefix _modbuiltin_, $(vmlinux-dirs))
>
> -%/modules.builtin: include/config/auto.conf include/config/tristate.conf
> -       $(Q)$(MAKE) $(modbuiltin)=$*
> +modules.builtin: $(modbuiltin-dirs)
> +       $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(vmlinux-dirs)) > $@
>
> +PHONY += $(modbuiltin-dirs)
> +# tristate.conf is not included from this Makefile. Add it as a prerequisite
> +# here to make it self-healing in case somebody accidentally removes it.
> +$(modbuiltin-dirs): include/config/tristate.conf
> +       $(Q)$(MAKE) $(modbuiltin)=$(patsubst _modbuiltin_%,%,$@)
>
>  # Target to prepare building external modules
>  PHONY += modules_prepare
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-07-06 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 16:13 [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada
2019-06-23 16:13 ` [PATCH 2/2] kbuild: split modules.order build rule out of 'modules' target Masahiro Yamada
2019-07-06 14:45 ` [PATCH 1/2] kbuild: fix missed rebuild of modules.builtin Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).