mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question on compiling a kernel Module
@ 2006-09-15 10:02 Madhav Bhamidipati
  2006-09-15 10:10 ` Jan Engelhardt
  2006-09-17 18:24 ` Sam Ravnborg
  0 siblings, 2 replies; 4+ messages in thread
From: Madhav Bhamidipati @ 2006-09-15 10:02 UTC (permalink / raw)
  To: linux-kernel

Hello,


I have the following source tree, objective is to get a single kernel
module.ko object.


module/
module/sub-module1
module/sub-module2
module/include
module/objs/


module folder has a Makefile, it may or may not have *.c files, it
invokes sub-* Makefiles
which build respective objects, these objects need to go into objs
folder, finally makefile in 'objs'
builds the module.ko linking all sub-module *.o.

I could not find much information for my requirement in the file
linux/Documentation/kbuild/makefiles.txt

any information with an example for my requirement is greatly
appreciated. Also let me know
how do I expose module/include in sub-module/ c files, looks like
-I../include is not working

-Madhav

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on compiling a kernel Module
  2006-09-15 10:02 Question on compiling a kernel Module Madhav Bhamidipati
@ 2006-09-15 10:10 ` Jan Engelhardt
  2006-09-15 10:20   ` Alexey Dobriyan
  2006-09-17 18:24 ` Sam Ravnborg
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2006-09-15 10:10 UTC (permalink / raw)
  To: Madhav Bhamidipati; +Cc: linux-kernel

>
> module/
> module/sub-module1
> module/sub-module2
> module/include
> module/objs/


obj-m += my.o
my-objs := sub1/foo.o sub1/bar.o sub2/abc.o sub2/xyz.o
EXTRA_CFLAGS += -I$(src)/include


Should be straightforward.

> module folder has a Makefile, it may or may not have *.c files, it
> invokes sub-* Makefiles
> which build respective objects, these objects need to go into objs
> folder, finally makefile in 'objs'
> builds the module.ko linking all sub-module *.o.
>
> I could not find much information for my requirement in the file
> linux/Documentation/kbuild/makefiles.txt
>
> any information with an example for my requirement is greatly
> appreciated. Also let me know
> how do I expose module/include in sub-module/ c files, looks like
> -I../include is not working


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on compiling a kernel Module
  2006-09-15 10:10 ` Jan Engelhardt
@ 2006-09-15 10:20   ` Alexey Dobriyan
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2006-09-15 10:20 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Madhav Bhamidipati, linux-kernel

On Fri, Sep 15, 2006 at 12:10:14PM +0200, Jan Engelhardt wrote:
> >
> > module/
> > module/sub-module1
> > module/sub-module2
> > module/include
> > module/objs/
>
>
> obj-m += my.o
> my-objs := sub1/foo.o sub1/bar.o sub2/abc.o sub2/xyz.o
> EXTRA_CFLAGS += -I$(src)/include
>
>
> Should be straightforward.

XFS does this and makes

	make fs/xfs/linux-2.6/xfs_stats.i

impossible.

>
> > module folder has a Makefile, it may or may not have *.c files, it
> > invokes sub-* Makefiles
> > which build respective objects, these objects need to go into objs
> > folder, finally makefile in 'objs'
> > builds the module.ko linking all sub-module *.o.
> >
> > I could not find much information for my requirement in the file
> > linux/Documentation/kbuild/makefiles.txt
> >
> > any information with an example for my requirement is greatly
> > appreciated. Also let me know
> > how do I expose module/include in sub-module/ c files, looks like
> > -I../include is not working


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on compiling a kernel Module
  2006-09-15 10:02 Question on compiling a kernel Module Madhav Bhamidipati
  2006-09-15 10:10 ` Jan Engelhardt
@ 2006-09-17 18:24 ` Sam Ravnborg
  1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2006-09-17 18:24 UTC (permalink / raw)
  To: Madhav Bhamidipati; +Cc: linux-kernel

On Fri, Sep 15, 2006 at 03:32:06PM +0530, Madhav Bhamidipati wrote:
> Hello,
> 
> 
> I have the following source tree, objective is to get a single kernel
> module.ko object.
> 
> 
> module/
> module/sub-module1
> module/sub-module2
> module/include
> module/objs/
> 
> 
> module folder has a Makefile, it may or may not have *.c files, it
> invokes sub-* Makefiles
> which build respective objects, these objects need to go into objs
> folder, finally makefile in 'objs'
> builds the module.ko linking all sub-module *.o.
> 
> I could not find much information for my requirement in the file
> linux/Documentation/kbuild/makefiles.txt
Please read modules.txt in same dir.

Let me know if you miss info (patchewelcome!).

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-09-17 18:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-15 10:02 Question on compiling a kernel Module Madhav Bhamidipati
2006-09-15 10:10 ` Jan Engelhardt
2006-09-15 10:20   ` Alexey Dobriyan
2006-09-17 18:24 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®