[lkml]   [2004]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 0/2] kbuild updates
    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.

    Andreas Gruenbacher <>
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:03    [W:0.021 / U:19.968 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site