lkml.org 
[lkml]   [2005]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Kbuild trick
On Sat, May 21, 2005 at 04:29:35PM +0530, Kedar Sovani wrote:
> One of the question that I haven't yet managed to solve properly is
> how do we manage kernel modules which have its C files in multiple
> underlying directories.
>
> say :
> /src/Makefile
> /src/main.c
> /src/module1/Makefile
> /src/module1/module1.c
> /src/module1/module_stuff.c
>
> And the 3 C files should be built into a single module at the top level.
> I tried something like this in the top level Makefile, but it does not work.
>
> obj-m += mymodule.o
> main-objs=main.o module1/

This create a number of modules - sometimes a good way to do it.
We have several examples in the kernel using this method.

>
> I could use,
> main-objs=main.o module1/module1.o module1/module_stuff.o
>
> But I don't think that is a good idea. I looked at
> Documentation/kbuild/, but no luck.
This is one way to do it.
The other way as used by the kernel is to avoid spreading the .c
files in multiple directories.

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-05-22 09:29    [W:0.171 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site