Blame view

scripts/Makefile.modinst 1.26 KB
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  # SPDX-License-Identifier: GPL-2.0
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
  # ==========================================================================
  # Installing modules
  # ==========================================================================
4f1933620   Paul Smith   kbuild: change kb...
5
  PHONY := __modinst
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
  __modinst:
8ec4b4ff1   Sam Ravnborg   kbuild: introduce...
7
  include scripts/Kbuild.include
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
8
9
  
  #
ef591a550   이건호   scripts/Makefile....
10
  __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
  modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
4f1933620   Paul Smith   kbuild: change kb...
12
  PHONY += $(modules)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
14
  __modinst: $(modules)
  	@:
f6a79af8f   Rusty Russell   modules: don't br...
15
  # Don't stop modules_install if we can't sign external modules.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
  quiet_cmd_modules_install = INSTALL $@
40e42f6a2   Bertrand Jacquin   modinst: wrap lon...
17
18
19
20
        cmd_modules_install = \
      mkdir -p $(2) ; \
      cp $@ $(2) ; \
      $(mod_strip_cmd) $(2)/$(notdir $@) ; \
caf6fe91d   David Woodhouse   modsign: Abort mo...
21
      $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \
beb50df39   Bertrand Jacquin   kbuild: handle mo...
22
      $(mod_compress_cmd) $(2)/$(notdir $@)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
23
24
25
  
  # Modules built outside the kernel source tree go into extra by default
  INSTALL_MOD_DIR ?= extra
9b213118f   Sam Ravnborg   kbuild: fix insta...
26
  ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
28
29
30
31
  
  modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
  
  $(modules):
  	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
4f1933620   Paul Smith   kbuild: change kb...
32
33
34
  
  
  # Declare the contents of the .PHONY variable as phony.  We keep that
8740e687a   Olaf Hering   kbuild: fix comme...
35
  # information in a variable so we can use it in if_changed and friends.
4f1933620   Paul Smith   kbuild: change kb...
36
37
  
  .PHONY: $(PHONY)