1 # ==========================================================================
3 # ==========================================================================
8 include scripts/Makefile.lib
12 __modules := $(shell cat /dev/null $(wildcard $(MODVERDIR)/*.mod))
13 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
15 ifneq ($(filter-out $(modules),$(__modules)),)
16 $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS, do not complain if something goes wrong.)
23 # Modules built within the kernel tree
25 quiet_cmd_modules_install = INSTALL $@
26 cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(@D); \
27 cp $@ $(MODLIB)/kernel/$(@D)
29 $(filter-out ../% /%,$(modules)):
30 $(call cmd,modules_install)
32 # Modules built outside just go into extra
34 quiet_cmd_modules_install_extra = INSTALL $(obj-m:.o=.ko)
35 cmd_modules_install_extra = mkdir -p $(MODLIB)/extra; \
38 $(filter ../% /%,$(modules)):
39 $(call cmd,modules_install_extra)