Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
1da177e4 LT |
2 | # ========================================================================== |
3 | # Installing modules | |
4 | # ========================================================================== | |
5 | ||
4f193362 | 6 | PHONY := __modinst |
1da177e4 LT |
7 | __modinst: |
8 | ||
3204a7fb | 9 | include $(srctree)/scripts/Kbuild.include |
1da177e4 | 10 | |
ccae4cfa MY |
11 | modules := $(sort $(shell cat $(MODORDER))) |
12 | ||
13 | ifeq ($(KBUILD_EXTMOD),) | |
14 | dst := $(MODLIB)/kernel | |
15 | else | |
16 | INSTALL_MOD_DIR ?= extra | |
17 | dst := $(MODLIB)/$(INSTALL_MOD_DIR) | |
18 | endif | |
19 | ||
20 | modules := $(patsubst $(extmod_prefix)%, $(dst)/%, $(modules)) | |
1da177e4 | 21 | |
1da177e4 LT |
22 | __modinst: $(modules) |
23 | @: | |
24 | ||
f6a79af8 | 25 | # Don't stop modules_install if we can't sign external modules. |
ccae4cfa MY |
26 | quiet_cmd_install = INSTALL $@ |
27 | cmd_install = \ | |
28 | mkdir -p $(dir $@); cp $< $@; \ | |
29 | $(mod_strip_cmd) $@; \ | |
30 | $(mod_sign_cmd) $@ $(patsubst %,|| true,$(KBUILD_EXTMOD)) ; \ | |
31 | $(mod_compress_cmd) $@ | |
32 | ||
33 | $(modules): $(dst)/%: $(extmod_prefix)% FORCE | |
34 | $(call cmd,install) | |
35 | ||
36 | PHONY += FORCE | |
37 | FORCE: | |
4f193362 | 38 | |
4f193362 | 39 | .PHONY: $(PHONY) |