Back to home page

LXR

 
 

    


0001 # ==========================================================================
0002 # Installing modules
0003 # ==========================================================================
0004 
0005 PHONY := __modinst
0006 __modinst:
0007 
0008 include scripts/Kbuild.include
0009 
0010 #
0011 
0012 __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
0013 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
0014 
0015 PHONY += $(modules)
0016 __modinst: $(modules)
0017         @:
0018 
0019 # Don't stop modules_install if we can't sign external modules.
0020 quiet_cmd_modules_install = INSTALL $@
0021       cmd_modules_install = \
0022     mkdir -p $(2) ; \
0023     cp $@ $(2) ; \
0024     $(mod_strip_cmd) $(2)/$(notdir $@) ; \
0025     $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \
0026     $(mod_compress_cmd) $(2)/$(notdir $@)
0027 
0028 # Modules built outside the kernel source tree go into extra by default
0029 INSTALL_MOD_DIR ?= extra
0030 ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
0031 
0032 modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
0033 
0034 $(modules):
0035         $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
0036 
0037 
0038 # Declare the contents of the .PHONY variable as phony.  We keep that
0039 # information in a variable so we can use it in if_changed and friends.
0040 
0041 .PHONY: $(PHONY)