diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index cc19b95c2116..13842693c143 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -67,7 +67,11 @@ __modpost: else -ifneq ($(KBUILD_EXTMOD),) +MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - + +ifeq ($(KBUILD_EXTMOD),) +MODPOST += $(wildcard vmlinux) +else # set src + obj - they may be used in the modules's Makefile obj := $(KBUILD_EXTMOD) @@ -78,8 +82,6 @@ include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ $(KBUILD_EXTMOD)/Kbuild, $(KBUILD_EXTMOD)/Makefile) endif -MODPOST += $(subst -i,-n,$(filter -i,$(MAKEFLAGS))) -s -T - $(wildcard vmlinux) - # find all modules listed in modules.order modules := $(sort $(shell cat $(MODORDER)))