Hi, Folks

I'm puzzled by the kbuild system in 2.6 kernel.
I want to write a kernel module, which consists of
several components. The module is produced by
linking these components. These components are located
in separate subdirectories (for example A, B,C). 
Each component is generated also by linking 
multiple files. (For example, a_1.c, a_2.c for
building A.o, b_1.c, b_2.c for building B.o, then A.o
and B.o
should be linked to produce mymodule.o) 

I know if I put all the files in a single directory
The makefile of the module looks like

obj-$(CONFIG_MYMODULE) += mymodule.o
mymodule-objs := a_1.o a_2.o b_1.o b_2.o c_1.o c_2.o

It should work. But it is really messy, especially
there are a lot of files or each component requires
different EXTRA_CFLAGS. However, if I write
separate Makefiles for each component in their own
subdirectory, the Makefile of component A looks like

obj-y := A.o (or obj-$(CONFIG_MYMODULE) +=  A.o)
A-objs := a_1.o a_2.o

This is wrong, because kbuild will treat A as
independent module. All I want is to treat
A as component of the only module mymodule.o. It
should be linked to mymodule.o

Any idea on how to write a kbuild Makefile to
support such kind of single module produced
by linking multiple components and each component
is located in separate directory? Thanks.

-Song







        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to