On Wed, Jul 14, 2004 at 02:40:44PM -0700, Song Wang wrote:
> Hi, Sam
>
> Thanks for the reply.
>
> However, in the way you indicate, the
> mainmodule and each submodule will be built
> as separate kernel modules. You will get
> mainmodule.ko, a_sub_module.ko, b_sub_module.ko etc.
>
> This is not what I tried to get. I tried to
> build a single kernel module, which means that
> mainmodule.o, a_sub_module.o, b_sub_module.o
> should be linked together to produce the single
> module.
OK.
This is even simpler:
Makefile:
EXTRA_CFLAGS := -I $(obj)/include
module-y := file.o dir/file.o
obj-m := module.o
And then code your C files as usual.
Assumig you have a directory named include.
Include header files like this:
#include "header.h"
So you end up having:
module/file.c
module/Makefile
module/dir/file.c
module/include/header.h
And you use:
make -C kernelsrcdir M=$PWD
to compile your module.
If this does not solve your issue please say so.
Sam
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel