* prob with 2.6 Makefile
@ 2005-11-14 6:04 Sapna Todwal
2005-11-14 20:27 ` Sam Ravnborg
0 siblings, 1 reply; 2+ messages in thread
From: Sapna Todwal @ 2005-11-14 6:04 UTC (permalink / raw)
To: linux-kernel
I have a few doubs with the 2.6 makefile
Suppose I have the following dir structure:
maindir
|
-------
| |
subdir1 subdir2
Now both of this subdirs have many .c files which are to be compiled and
linked together to make final1.o & final2.o files in the subdirs
subdir1 & subdir2 respectively.
Now i want to link this two files subdir1/final1.o & subdir2/final2.o ,
in the maindir to make file say final.o file in maindir .
So the Makefile in maindir looks like:
obj-m := subdir1/ subdir2/
This will traverse the subdir1 & subdir2 and call their makefiles.
But how do i make final.o from subdir1/final1.o and subdir2/final2.o
Kindly help me with the solution.
Thanks in advance,
Regards,
Sapna
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: prob with 2.6 Makefile
2005-11-14 6:04 prob with 2.6 Makefile Sapna Todwal
@ 2005-11-14 20:27 ` Sam Ravnborg
0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2005-11-14 20:27 UTC (permalink / raw)
To: sapna; +Cc: linux-kernel
Hi Sapna.
> I have a few doubs with the 2.6 makefile
> Suppose I have the following dir structure:
> maindir
> |
> -------
> | |
> subdir1 subdir2
>
> Now both of this subdirs have many .c files which are to be compiled and
> linked together to make final1.o & final2.o files in the subdirs
> subdir1 & subdir2 respectively.
>
> Now i want to link this two files subdir1/final1.o & subdir2/final2.o ,
> in the maindir to make file say final.o file in maindir .
I suppose we are here discussing an external project where you want to
build a single module.
kbuild (and the kbuild syntax) is optimized for the pattern seen most
often in the kernel. And only in very rare cases we have a module split
over more than one directory. In the nomal cases everything are kept
together.
fs/xfs is one example where we do split up the source code in several dirs.
So there are only two possibilities:
1) Do like the rest of the kernel and keep the files in one dir
2) Specify all .o files in the top-level kbuild (Makefile) file.
Like this:
obj-m := module.o
module-y := subdir1/foo.o
module-y += subdir1/bar.o
module-y += subdir2/fooo.o
module-y += subdir2/baro.o
Sam
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-11-14 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-14 6:04 prob with 2.6 Makefile Sapna Todwal
2005-11-14 20:27 ` 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®