aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada2019-06-24 01:13:27 +0900
committerMasahiro Yamada2019-07-01 10:04:46 +0900
commit50ef0cdf58aea2f03f3d21390d68561ee7be215e (patch)
tree61d25827a40cb78efdabf1da96fb2634e2fdd0df /Makefile
parentc2341e2a4f58d8e27d89c5edfefdaa52547f792d (diff)
kbuild: fix missed rebuild of modules.builtin
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 does not notice a change in Makefile, for example, the rename of modules. Kbuild must always descend into directories for modules.builtin too. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 1f35aca4fe05..f8e4f930e497 100644
--- a/Makefile
+++ b/Makefile
@@ -1292,12 +1292,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