Blame view

scripts/Makefile.modinst 1.02 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
  # ==========================================================================
  # Installing modules
  # ==========================================================================
4f1933620   Paul Smith   kbuild: change kb...
4
  PHONY := __modinst
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
  __modinst:
8ec4b4ff1   Sam Ravnborg   kbuild: introduce...
6
  include scripts/Kbuild.include
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
7
8
9
10
11
  
  #
  
  __modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
  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
15
16
  __modinst: $(modules)
  	@:
  
  quiet_cmd_modules_install = INSTALL $@
2ea038917   Sam Ravnborg   Revert "kbuild: s...
17
        cmd_modules_install = mkdir -p $(2); cp $@ $(2) ; $(mod_strip_cmd) $(2)/$(notdir $@)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
18
19
20
  
  # Modules built outside the kernel source tree go into extra by default
  INSTALL_MOD_DIR ?= extra
9b213118f   Sam Ravnborg   kbuild: fix insta...
21
  ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
  
  modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
  
  $(modules):
  	$(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
4f1933620   Paul Smith   kbuild: change kb...
27
28
29
30
31
32
  
  
  # Declare the contents of the .PHONY variable as phony.  We keep that
  # information in a variable se we can use it in if_changed and friends.
  
  .PHONY: $(PHONY)