Commit ac844bd1 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Handle external SUBDIRS with modversions

We need to collect a list of all modules during the recursive build. I used
a "touch .tmp_versions/<path/to/module.ko>" to do so, which however doesn't
work so well, when path/to isn't inside the kernel tree.
  
The best way to build external modules is currently using kbuild by saying
"make SUBDIRS=/some/external/dir modules", which was thus broken. While this
way is not all that optimal and I hope to come up with something better
before 2.6, it works and should keep working, so this patch fixes the usage
above.
  
Instead of touching files with the entire path added, we just create a
<module>.mod file in $(MODVERDIR) now, and save the path to the module.ko 
in it. Since module names are unique, a flat hierarchy is actually fine here.
parent 03e21831
......@@ -408,6 +408,7 @@ ifdef CONFIG_MODVERSIONS
ifdef KBUILD_MODULES
ifeq ($(origin SUBDIRS),file)
$(Q)rm -rf $(MODVERDIR)
$(Q)mkdir $(MODVERDIR)
else
@echo '*** Warning: Overriding SUBDIRS on the command line can cause'
@echo '*** inconsistencies with module symbol versions'
......
......@@ -47,7 +47,7 @@ endif
ifdef CONFIG_MODVERSIONS
modules := $(obj-m)
touch-module = @mkdir -p $(MODVERDIR)/$(@D); touch $(MODVERDIR)/$(@:.o=.ko)
touch-module = @echo $(@:.o=.ko) > .tmp_versions/$(@F:.o=.mod)
else
modules := $(obj-m:.o=.ko)
endif
......
......@@ -9,7 +9,7 @@ include scripts/Makefile.lib
#
modules := $(patsubst ./%,%,$(shell cd $(MODVERDIR); find . -name \*.ko))
modules := $(shell cd $(MODVERDIR); cat *.mod)
__modversions: $(modules)
@:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment