]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - scripts/Makefile.modinst
x86/msr-index: Cleanup bit defines
[mirror_ubuntu-bionic-kernel.git] / scripts / Makefile.modinst
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
1da177e4
LT
2# ==========================================================================
3# Installing modules
4# ==========================================================================
5
4f193362 6PHONY := __modinst
1da177e4
LT
7__modinst:
8
8ec4b4ff 9include scripts/Kbuild.include
1da177e4
LT
10
11#
12
ef591a55 13__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
1da177e4
LT
14modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
15
4f193362 16PHONY += $(modules)
1da177e4
LT
17__modinst: $(modules)
18 @:
19
f6a79af8 20# Don't stop modules_install if we can't sign external modules.
1da177e4 21quiet_cmd_modules_install = INSTALL $@
40e42f6a
BJ
22 cmd_modules_install = \
23 mkdir -p $(2) ; \
24 cp $@ $(2) ; \
25 $(mod_strip_cmd) $(2)/$(notdir $@) ; \
0d34a427 26 if (echo "$(2)/$(notdir $@)" | egrep -q "\/drivers\/staging\/") && \
f44350db
SF
27 [ -f $(srctree)/drivers/staging/signature-inclusion ] && \
28 (! egrep -x "$(notdir $@)" $(srctree)/drivers/staging/signature-inclusion) ; \
0d34a427
LO
29 then echo Not signing "$(2)/$(notdir $@)"; \
30 else $(mod_sign_cmd) $(2)/$(notdir $@) $(patsubst %,|| true,$(KBUILD_EXTMOD)) && \
31 $(mod_compress_cmd) $(2)/$(notdir $@); fi
1da177e4
LT
32
33# Modules built outside the kernel source tree go into extra by default
34INSTALL_MOD_DIR ?= extra
9b213118 35ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
1da177e4
LT
36
37modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
38
39$(modules):
40 $(call cmd,modules_install,$(MODLIB)/$(modinst_dir))
4f193362
PS
41
42
43# Declare the contents of the .PHONY variable as phony. We keep that
8740e687 44# information in a variable so we can use it in if_changed and friends.
4f193362
PS
45
46.PHONY: $(PHONY)