summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-01-28 23:51:57 +0100
committerSam Ravnborg <sam@mars.ravnborg.org>2006-02-19 09:51:20 +0100
commita67dc21a38055ec2d8d85b2f64d98091748569b3 (patch)
tree7d9e969b5c7b0b065480f782412a7129c20f1879 /Makefile
parentfb3cbd2e575f9ac0700bfa1e7cb9f4119fbd0abd (diff)
downloadlinux-a67dc21a38055ec2d8d85b2f64d98091748569b3.tar.bz2
kbuild: run depmod when installing external modules
Following patch enables depmod support when installing external modules. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index fdb3dac3e70f..c55d0f1b85ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1147,9 +1147,28 @@ modules: $(module-dirs)
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modpost
.PHONY: modules_install
-modules_install:
+modules_install: _emodinst_ _emodinst_post
+
+install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)
+.PHONY: _emodinst_
+_emodinst_:
+ $(Q)rm -rf $(MODLIB)/$(install-dir)
+ $(Q)mkdir -p $(MODLIB)/$(install-dir)
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
+# Run depmod only is we have System.map and depmod is executable
+quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
+ cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
+ $(DEPMOD) -ae -F System.map \
+ $(if $(strip $(INSTALL_MOD_PATH)), \
+ -b $(INSTALL_MOD_PATH) -r) \
+ $(KERNELRELEASE); \
+ fi
+
+.PHONY: _emodinst_post
+_emodinst_post: _emodinst_
+ $(call cmd,depmod)
+
clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD))
.PHONY: $(clean-dirs) clean