Re: [kbuild-devel] Help in Makefile for Kernel module
Hello Sam, Thanks for your help. As per your suggestion I modified the Makefile. However I get main.ko in the maind directory and foobard.ko in foobard directory. These are two independent kernel modules. I tried several other things in the Makefile and I did not make any progress to build one kernel module of the whole tree. Any help on this will be appreciated. Now the tree is as: testd | |-- Makefile | |--maind || ||-- Makefile ||-- main.c | | |--foobard | | |-- Makefile |-- foobar1.c |-- foobar2.c The Makefile in the root directory has: obj-m := maind/ foobard/ The Makefile in the maind directory has: obj-m := main.o The Makefile in the foobard directory has: obj-m:= foobard.o foobard-y := foobar1.o foobar2.o In the testd directory, I run make -C /usr/src/linux-2.6.11.7 M=$(pwd) modules Thanks for any help Regards Suzzane _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel
Re: [kbuild-devel] Help in Makefile for Kernel module
Hi Suzzane However I would like to know if it is possible to have a Makefile inside the foobard directory that will link foobar1.o and foobar2.o into one say foobar.o and have the below line as: The lowest granularity the kbuild system works with is a module. So what you can do is to define a module in the foobard/ directory. Then you would stick a dependency on this module in your top-level module in maind/. The Makefile's would look like this: Makefile (stripped all the conditional stuff): obj-m := maind/ foobard/ foobard/Makefile: obj-m := foobard.o foobard-y := foobar1.o foobar2.o maind/Makefile: obj-m := main.o Sam --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel