kbuild: make it possible to specify the module output dir
authorRom Lemarchand <romlem@android.com>
Fri, 6 Feb 2015 00:07:59 +0000 (16:07 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:54:19 +0000 (13:54 -0800)
Make modinst_dir user-defined on the command line.

This allows to do things like:
make MODLIB=output/ modinst_dir=. modules_install

to ensure all the .ko are in the output/ directory.

Change-Id: I2bc007eea27ee744d35289e26e4a8ac43ba04151
Signed-off-by: Rom Lemarchand <romlem@android.com>
scripts/Makefile.modinst

index 07650eeaaf06dd85bb5f3439959ed05c36d8a5ff..6f4c3f5a7ae39b186019c4d4f587fedef50af699 100644 (file)
@@ -29,7 +29,7 @@ quiet_cmd_modules_install = INSTALL $@
 INSTALL_MOD_DIR ?= extra
 ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
 
-modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
+modinst_dir ?= $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
 
 $(modules):
        $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))