drivers: power: report battery voltage in AOSP compatible format
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / scripts / Makefile.android.modinst
1 # ==========================================================================
2 # Installing modules
3 # ==========================================================================
4
5 PHONY := __modinst
6 __modinst:
7
8 include scripts/Kbuild.include
9
10 __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
11 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
12
13 #PHONY += $(modules)
14 __modinst:
15 @:
16
17
18 #$(info modules = $(modules))
19 INSTALL_MOD_DIR ?= extra
20 list_modules_symbol_install :=
21 list_modules_install :=
22
23 ifdef KBUILD_EXTMOD
24 #$(error Unexpect condition KBUILD_EXTMOD = $(KBUILD_EXTMOD))
25 AMODLIB := $(INSTALL_MOD_DIR)/lib/modules
26 AMODSYMLIB := $(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 )
35 else
36 AMODLIB := $(INSTALL_MOD_PATH)/lib/modules
37 AMODSYMLIB := $(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 )
46 endif
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)