Messages in this thread | | | From | Andreas Gruenbacher <> | Subject | Re: [PATCH 0/2] kbuild updates | Date | Mon, 21 Jun 2004 00:26:43 +0200 |
| |
On Sunday 20 June 2004 23:52, Martin Schlemmer wrote: > On Sun, 2004-06-20 at 23:42, Arjan van de Ven wrote: > > > Given, but to 'use' the kbuild infrastructure, you must still call it > > > via: > > > > > > make -C _path_to_sources M=`pwd` > > > > I see no problem with requiring this though; requiring a correct > > makefile is perfectly fine with me, and this is the only and documented > > way for 2.6 already. > > (And it's also the only way to build modules against Fedora Core 2 > > kernels by the way) > > I did not mean I have a problem with that. Say you take svgalib, and > you want the build system to automatically compile the kernel module, > you might do something like: > > --- > build_2_6_module: > @make -C /lib/modules/`uname -r`/build M=`PWD` > --- > > will break with proposed patch ...
No it won't.
You always need to figure out $(objtree) to build external modules, with or without a separate output directory. Many modules don't need to know $(srctree) explicitly at all.
In case you want to do something depending on the sources/confguration, there are two ways: - follow the new source symlink, - let kbuild take you to $(srctree): When the makefile in the M directory is included, the current working directory is $(srctree). besides, all the usual variables like $(srctree), $(objtree), CONFIG_* variables, etc. are all available. That's a good time to check for features, etc.
> And the point I wanted to make was that AFIAK > '/lib/modules/`uname -r`/build' is an interface to figure > out where the _sources_ for the current running kernel are > located.
That's a misconception. At the minimum, you want to be able to build the module. Directly messing with the sources is usually wrong. I know external module authors like to do that nevertheless; in a few cases it's actually useful. Most of the time it really is not. Most external modules have totally braindead/broken makefiles.
Regards, -- Andreas Gruenbacher <agruen@suse.de> SUSE Labs, SUSE LINUX AG - 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/
| |