I have two out-of-tree modules that I compile with the M=
mechanics, one of the modules has imports from the other one.
I tried to follow modules.txt and put an KBUILD_EXTRA_SYMBOLS
when building. Somewhat like below:
# derived.ko module Makefile
# $(BASE_MODULE_DIR) must point to base.ko source directory
KBUILD_BASE = +$(MAKE) -C $(KSRC) M=`pwd` KBUILD_OUTPUT=$(KBUILD_OUTPUT) ARCH=$(ARCH)
derived:
$(KBUILD_BASE) KBUILD_EXTRA_SYMBOLS=$(BASE_MODULE_DIR) modules
But doing this does work:
# derived module Makefile
# $(BASE_MODULE_DIR) must point to base.ko source directory
KBUILD_BASE = +$(MAKE) -C $(KSRC) M=`pwd` KBUILD_OUTPUT=$(KBUILD_OUTPUT) ARCH=$(ARCH)
derived:
$(KBUILD_BASE) KBUILD_EXTMOD=$(BASE_MODULE_DIR) modules
The diff is s/KBUILD_EXTRA_SYMBOLS/KBUILD_EXTMOD.
It took me a long while and inspection the git-log of
Documentation/kbuild/modules.txt to figure that out. Perhaps an example
is do in documentation.
What am I doing wrong?
Thanks
Boaz
--