diff options
author | Sam Ravnborg <sam@neptun.(none)> | 2007-10-19 16:20:02 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-19 16:20:02 -0400 |
commit | 7bb9d092de0b21f8f3f0a20dc2ec84395549fb62 (patch) | |
tree | f5a88707627e03f028dc20babb92c834aa2a9915 /Makefile | |
parent | 6e66b9005dfc9e0bc6785d734745a4bf8f85f16b (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-- | Makefile | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -884,10 +884,7 @@ prepare2: prepare3 outputmakefile | |||
884 | 884 | ||
885 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ | 885 | prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ |
886 | include/asm include/config/auto.conf | 886 | include/asm include/config/auto.conf |
887 | ifneq ($(KBUILD_MODULES),) | 887 | $(cmd_crmodverdir) |
888 | $(Q)mkdir -p $(MODVERDIR) | ||
889 | $(Q)rm -f $(MODVERDIR)/* | ||
890 | endif | ||
891 | 888 | ||
892 | archprepare: prepare1 scripts_basic | 889 | archprepare: prepare1 scripts_basic |
893 | 890 | ||
@@ -1223,8 +1220,7 @@ else # KBUILD_EXTMOD | |||
1223 | KBUILD_MODULES := 1 | 1220 | KBUILD_MODULES := 1 |
1224 | PHONY += crmodverdir | 1221 | PHONY += crmodverdir |
1225 | crmodverdir: | 1222 | crmodverdir: |
1226 | $(Q)mkdir -p $(MODVERDIR) | 1223 | $(cmd_crmodverdir) |
1227 | $(Q)rm -f $(MODVERDIR)/* | ||
1228 | 1224 | ||
1229 | PHONY += $(objtree)/Module.symvers | 1225 | PHONY += $(objtree)/Module.symvers |
1230 | $(objtree)/Module.symvers: | 1226 | $(objtree)/Module.symvers: |
@@ -1484,9 +1480,11 @@ endif | |||
1484 | 1480 | ||
1485 | # Modules | 1481 | # Modules |
1486 | / %/: prepare scripts FORCE | 1482 | / %/: prepare scripts FORCE |
1483 | $(cmd_crmodverdir) | ||
1487 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1484 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1488 | $(build)=$(build-dir) | 1485 | $(build)=$(build-dir) |
1489 | %.ko: prepare scripts FORCE | 1486 | %.ko: prepare scripts FORCE |
1487 | $(cmd_crmodverdir) | ||
1490 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1488 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1491 | $(build)=$(build-dir) $(@:.ko=.o) | 1489 | $(build)=$(build-dir) $(@:.ko=.o) |
1492 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1490 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |
@@ -1510,6 +1508,9 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) | |||
1510 | $(KERNELRELEASE); \ | 1508 | $(KERNELRELEASE); \ |
1511 | fi | 1509 | fi |
1512 | 1510 | ||
1511 | # Create temporary dir for module support files | ||
1512 | cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/* | ||
1513 | |||
1513 | 1514 | ||
1514 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1515 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ |
1515 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ | 1516 | $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ |