vserver 2.0 rc7
[linux-2.6.git] / scripts / Makefile.modinst
index ba47b7f..85d6494 100644 (file)
@@ -21,8 +21,9 @@ quiet_cmd_modules_install = INSTALL $@
 
 # Modules built outside the kernel source tree go into extra by default
 INSTALL_MOD_DIR ?= extra
+ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D))
 
-modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D))
+modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
 
 $(modules):
-       $(call cmd,modules_install,$(modinst_dir))
+       $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))