1 # ==========================================================================
3 # ==========================================================================
8 include scripts/Kbuild.include
10 __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
11 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
18 #$(info modules = $(modules))
19 INSTALL_MOD_DIR ?= extra
20 list_modules_symbol_install :=
21 list_modules_install :=
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)) \
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)) \
48 #$(info list_modules_symbol_install = $(list_modules_symbol_install))
49 #$(info list_modules_install = $(list_modules_install))
50 $(list_modules_install):
56 $(list_modules_symbol_install):
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.