Skip to contentSkip to conversation

Help Require for makeing 2.6 kernel makefile

DISCUSSION murtuja bharmal 2 participants 3 messages Feb 11, 2008 – Feb 15, 2008 1 message not in the archive Kbuild

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 47 lines · --- Sam Ravnborg
Quoted 3 lines · murtuja bharmal

Hello Sam,

Can we write a kernel makefile using KBUILD to

make

Quoted 1 line

kernel module, for which source file are in

different

Quoted 4 lines

directory.

For example.
In Directory “test1/” I have a two file Hello1.c

and

Quoted 2 lines

Hello2.c
First I want to make Hello1.o and Hello2.o and

after

Quoted 4 lines

linking it will be Hello3.o.
For Hello3.o output directory will be “test2/”

In Directory “test4/” I have a file Hello4.c,

after

Quoted 6 lines

compiling, it will be Hell4.o.
For Hello4.o Output directory will be “test2/”. Now after linking Hell1.o and Hello4.o. I want to make Hello.ko in directory “test5/”.

Can we have separate makefile for “test1” and

“test4”

Quoted 1 line

directory.

You cannot achieve exactly what you want - sorry.
test1/Makefile would look like this:
obj-m := Hello3.o
Hello3-y := Hello1.o Hello2.o

test4/Makefile would look like this:
obj-m := Hello4.o

You could create a Makefile in the directory
above test1/ and test4/ that looks like this:

obj-m := test1/ test4/

So you could build both modules in one go.
And then you could use make modules_install to
install them.

Quoted 8 lines

Hope this helps.

PS. Please post such questions to
[email protected].
We are a community so use it.

Sam

Hi,

Actually problem is I have 2000 source file for
single kernel module with 2.4 kbuild architecture. All this source file are in different directory sturcture.
I can not split this in to multiple modules. And In 2.4 makefile it is not tightly binded with kbuild.
It is like complining some file and linking it, putting it in some directory and so on and finally making module from all linked files.
It has near about 100 makefiles for 2.4 architecture.

Now I m not able to findout the way how I will achive this with 2.6 kbuild system because in all directory there is one makefile, which is making intermidiate object file, say form 10 source file, then again at last we are linking all this intermidate object file and making a single module.

Murtuja

Meet people who discuss and share your passions. Go to http://in.promos.yahoo.com/groups

#2 lore raw
Quoted 4 lines

Actually problem is I have 2000 source file for
single kernel module with 2.4 kbuild architecture. All this source file are in different directory sturcture.

A big module I must say...
Take a look at fs/xfs/
they have source scattered over a few directories. But you will require a single kbuild file listing all the .o file that is generated.
But with the dense syntax used by kbuild that should not be a problem.

If you continue to struggle upload the code somwhere and let us take a look.

Sam