kbuild: Allow install of external modules to custom path
authorAndreas Gruenbacher <agruen@suse.de>
Sun, 17 Oct 2004 01:48:22 +0000 (03:48 +0200)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sun, 17 Oct 2004 01:48:22 +0000 (03:48 +0200)
Currently, a ``make modules_install'' for an external module will
install that module into /lib/modules/$(uname -r)/extra. Allow to
override this default by specifying INSTALL_MOD_DIR.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

scripts/Makefile.modinst

index b9ab77d..ba47b7f 100644 (file)
@@ -19,7 +19,10 @@ __modinst: $(modules)
 quiet_cmd_modules_install = INSTALL $@
       cmd_modules_install = mkdir -p $(2); cp $@ $(2)
 
-modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),extra/,kernel/$(@D))
+# Modules built outside the kernel source tree go into extra by default
+INSTALL_MOD_DIR ?= extra
+
+modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D))
 
 $(modules):
        $(call cmd,modules_install,$(modinst_dir))