kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 30 Jul 2019 15:59:00 +0000 (00:59 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 31 Jul 2019 15:09:49 +0000 (00:09 +0900)
KBUILD_EXTRA_SYMBOLS makes sense only when building external modules.
Moreover, the modpost sets 'external_module' if the -e option is given.

I replaced $(patsubst %, -e %,...) with simpler $(addprefix -e,...)
while I was here.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/Makefile.modpost

index ad4b9829a456b57952f69bd2553951f2d91ab94c..c856512349cd207aab7a8fb60ced8f91f53f3a83 100644 (file)
@@ -78,7 +78,7 @@ modpost = scripts/mod/modpost                    \
  $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,)       \
  $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile)   \
  $(if $(KBUILD_EXTMOD),-I $(modulesymfile))      \
- $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \
+ $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
  $(if $(KBUILD_EXTMOD),-o $(modulesymfile))      \
  $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E)  \
  $(if $(KBUILD_MODPOST_WARN),-w)