drivers: power: report battery voltage in AOSP compatible format
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / scripts / Makefile.android.modinst
CommitLineData
6fa3eb70
S
1# ==========================================================================
2# Installing modules
3# ==========================================================================
4
5PHONY := __modinst
6__modinst:
7
8include scripts/Kbuild.include
9
10__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
11modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
12
13#PHONY += $(modules)
14__modinst:
15 @:
16
17
18#$(info modules = $(modules))
19INSTALL_MOD_DIR ?= extra
20list_modules_symbol_install :=
21list_modules_install :=
22
23ifdef KBUILD_EXTMOD
24#$(error Unexpect condition KBUILD_EXTMOD = $(KBUILD_EXTMOD))
25AMODLIB := $(INSTALL_MOD_DIR)/lib/modules
26AMODSYMLIB := $(INSTALL_MOD_DIR)/../symbols/system/lib/modules
27$(foreach ko,$(modules),\
28 $(eval src0 := $(ko)) \
29 $(eval des1 := $(AMODSYMLIB)/$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(dir $(ko)))/$(notdir $(ko))) \
30 $(eval des2 := $(AMODLIB)/$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(dir $(ko)))/$(notdir $(ko))) \
31 $(eval $(des1) $(des2): $(src0)) \
32 $(eval list_modules_symbol_install += $(des1)) \
33 $(eval list_modules_install += $(des2)) \
34)
35else
36AMODLIB := $(INSTALL_MOD_PATH)/lib/modules
37AMODSYMLIB := $(INSTALL_MOD_PATH)/../symbols/system/lib/modules
38$(foreach ko,$(modules),\
39 $(eval src0 := $(ko)) \
40 $(eval des1 := $(AMODSYMLIB)/$(notdir $(ko))) \
41 $(eval des2 := $(AMODLIB)/$(notdir $(ko))) \
42 $(eval $(des1) $(des2): $(src0)) \
43 $(eval list_modules_symbol_install += $(des1)) \
44 $(eval list_modules_install += $(des2)) \
45)
46endif
47
48#$(info list_modules_symbol_install = $(list_modules_symbol_install))
49#$(info list_modules_install = $(list_modules_install))
50$(list_modules_install):
51 @echo INSTALL $@
52 @mkdir -p $(dir $@)
53 @cp $< $@
54 @$(mod_strip_cmd) $@
55
56$(list_modules_symbol_install):
57 @echo COPY $@
58 @mkdir -p $(dir $@)
59 @cp $< $@
60
61__modinst: $(list_modules_install) $(list_modules_symbol_install)
62# Declare the contents of the .PHONY variable as phony. We keep that
63# information in a variable se we can use it in if_changed and friends.
64
65.PHONY: $(PHONY)