summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.(none)>2007-10-19 22:20:02 +0200
committerSam Ravnborg <sam@neptun.(none)>2007-10-19 22:20:02 +0200
commit7bb9d092de0b21f8f3f0a20dc2ec84395549fb62 (patch)
treef5a88707627e03f028dc20babb92c834aa2a9915 /Makefile
parent6e66b9005dfc9e0bc6785d734745a4bf8f85f16b (diff)
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: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 784903a63e0..6d7527cee9f 100644
--- a/Makefile
+++ b/Makefile
@@ -884,10 +884,7 @@ prepare2: prepare3 outputmakefile
prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
include/asm include/config/auto.conf
-ifneq ($(KBUILD_MODULES),)
- $(Q)mkdir -p $(MODVERDIR)
- $(Q)rm -f $(MODVERDIR)/*
-endif
+ $(cmd_crmodverdir)
archprepare: prepare1 scripts_basic
@@ -1223,8 +1220,7 @@ else # KBUILD_EXTMOD
KBUILD_MODULES := 1
PHONY += crmodverdir
crmodverdir:
- $(Q)mkdir -p $(MODVERDIR)
- $(Q)rm -f $(MODVERDIR)/*
+ $(cmd_crmodverdir)
PHONY += $(objtree)/Module.symvers
$(objtree)/Module.symvers:
@@ -1484,9 +1480,11 @@ endif
# Modules
/ %/: prepare scripts FORCE
+ $(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir)
%.ko: prepare scripts FORCE
+ $(cmd_crmodverdir)
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1510,6 +1508,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
$(KERNELRELEASE); \
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) \
$(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \