summaryrefslogtreecommitdiff
path: root/scripts/Makefile.modpost
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-09-15 15:26:23 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2022-09-29 06:08:18 +0900
commit425937381ec492d454cd4d8ba594711331128a44 (patch)
tree580fdf08e7ab9382f968386bcae626b0df7be2e7 /scripts/Makefile.modpost
parentf73edc8951b2de515b5ecc8a357ccd47dd41077e (diff)
kbuild: re-run modpost when it is updated
Modpost generates .vmlinux.export.c and *.mod.c, which are prerequisites of vmlinux and modules, respectively. The modpost stage should be re-run when the modpost code is updated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.modpost')
-rw-r--r--scripts/Makefile.modpost14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 2daf760eeb25..40a3e9b0512b 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -38,7 +38,7 @@ __modpost:
include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
-MODPOST = scripts/mod/modpost \
+modpost-args = \
$(if $(CONFIG_MODVERSIONS),-m) \
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
@@ -48,7 +48,7 @@ MODPOST = scripts/mod/modpost \
# 'make -i -k' ignores compile errors, and builds as many modules as possible.
ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),)
-MODPOST += -n
+modpost-args += -n
endif
ifeq ($(KBUILD_EXTMOD),)
@@ -100,16 +100,18 @@ module.symvers-if-present := $(wildcard Module.symvers)
output-symdump := $(KBUILD_EXTMOD)/Module.symvers
missing-input := $(filter-out $(module.symvers-if-present), Module.symvers)
-MODPOST += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS))
+modpost-args += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS))
endif # ($(KBUILD_EXTMOD),)
ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),)
-MODPOST += -w
+modpost-args += -w
endif
modorder-if-needed := $(if $(KBUILD_MODULES), $(MODORDER))
+MODPOST = scripts/mod/modpost
+
# Read out modules.order to pass in modpost.
# Otherwise, allmodconfig would fail with "Argument list too long".
quiet_cmd_modpost = MODPOST $@
@@ -118,10 +120,10 @@ quiet_cmd_modpost = MODPOST $@
echo >&2 "WARNING: $(missing-input) is missing."; \
echo >&2 " Modules may not have dependencies or modversions."; \
echo >&2 " You may get many unresolved symbol warnings.";) \
- sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(vmlinux.o-if-present) -T -
+ sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) $(vmlinux.o-if-present) -T -
targets += $(output-symdump)
-$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) FORCE
+$(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) $(MODPOST) FORCE
$(call if_changed,modpost)
__modpost: $(output-symdump)