Commit 7bb9d092 authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: fix first module build

When building a specific module before doing a total kernel
build it failed because $(MORVERDIR) were missing.
Creating the MODVERDIR explicit (independent of KBUILD_MODULES)
fixed this. As a side-effect the MODVERDIR will be created
also for a non-module build - but no harm done by that.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 6e66b900
...@@ -884,10 +884,7 @@ prepare2: prepare3 outputmakefile ...@@ -884,10 +884,7 @@ prepare2: prepare3 outputmakefile
prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
include/asm include/config/auto.conf include/asm include/config/auto.conf
ifneq ($(KBUILD_MODULES),) $(cmd_crmodverdir)
$(Q)mkdir -p $(MODVERDIR)
$(Q)rm -f $(MODVERDIR)/*
endif
archprepare: prepare1 scripts_basic archprepare: prepare1 scripts_basic
...@@ -1223,8 +1220,7 @@ else # KBUILD_EXTMOD ...@@ -1223,8 +1220,7 @@ else # KBUILD_EXTMOD
KBUILD_MODULES := 1 KBUILD_MODULES := 1
PHONY += crmodverdir PHONY += crmodverdir
crmodverdir: crmodverdir:
$(Q)mkdir -p $(MODVERDIR) $(cmd_crmodverdir)
$(Q)rm -f $(MODVERDIR)/*
PHONY += $(objtree)/Module.symvers PHONY += $(objtree)/Module.symvers
$(objtree)/Module.symvers: $(objtree)/Module.symvers:
...@@ -1484,9 +1480,11 @@ endif ...@@ -1484,9 +1480,11 @@ endif
# Modules # Modules
/ %/: prepare scripts FORCE / %/: prepare scripts FORCE
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(build)=$(build-dir)
%.ko: prepare scripts FORCE %.ko: prepare scripts FORCE
$(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o) $(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
...@@ -1510,6 +1508,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) ...@@ -1510,6 +1508,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
$(KERNELRELEASE); \ $(KERNELRELEASE); \
fi fi
# Create temporary dir for module support files
cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/*
a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
$(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment