Re: [PATCH] out-of-tree builds

From: Geert Uytterhoeven (geert_at_linux-m68k.org)
Date: 03/22/04

  • Next message: Richard B. Johnson: "RE: spurious 8259A interrupt"
    Date:	Mon, 22 Mar 2004 23:09:52 +0100 (MET)
    To: Kai Germaschewski <kai@germaschewski.name>, Sam Ravnborg <sam@ravnborg.org>
    
    

    On Mon, 15 Mar 2004, Geert Uytterhoeven wrote:
    > On Sun, 14 Mar 2004, Geert Uytterhoeven wrote:
    > > Although I like the feature to build a kernel in a different directory a lot, I
    > > don't like its syntax. I prefer to just have a build directory where I can run
    > > `make whatever'.
    > >
    > > The following patch adds a configure script to the kernel. If you run
    > >
    > > /path/to/kernel/source/tree/configure
    > >
    > > it will create a Makefile in the current directory, after which you can just do
    > > `make whatever', just like in the source directory.
    >
    > Unfortunately not everything works.
    >
    > E.g. I need to build usr/ with a different (newer) binutils, so when the build
    > fails on assembling usr/initramfs_data.o, I used to do the following, which no
    > longer works:
    >
    > | tux$ PATH=/usr/bin/:$PATH make usr/
    > | make: `usr/' is up to date.
    > | tux$
    >
    > I guess I need a catch-all .PHONY rule, but don't know how to implement it...

    `info make' never hurts...

    --- linux-2.6.x/Makefile.in.orig 2004-02-08 10:50:36.000000000 +0100
    +++ linux-2.6.x/Makefile.in 2004-03-22 23:02:29.000000000 +0100
    @@ -0,0 +1,12 @@
    +
    +srcdir = @srcdir@
    +
    +dstdir = $(shell pwd)
    +
    +all:
    + @$(MAKE) -C $(srcdir) O=$(dstdir)
    +
    +%: force
    + @$(MAKE) -C $(srcdir) O=$(dstdir) $@
    +
    +force: ;
    --- linux-2.6.x/configure.orig 2004-02-08 10:50:36.000000000 +0100
    +++ linux-2.6.x/configure 2004-03-15 10:27:00.000000000 +0100
    @@ -0,0 +1,17 @@
    +#!/bin/sh
    +
    +srcdir=$(dirname $0)
    +dstdir=$(pwd)
    +
    +if [ $srcdir = . -o $srcdir = $dstdir ]; then
    + echo Building in Linux kernel source tree, nothing changed
    +else
    + if [ -e Makefile ]; then
    + /bin/mv Makefile Makefile.bak
    + fi
    + echo '# Generated automatically from Makefile.in by configure.' > Makefile
    + /bin/sed -e s+@srcdir@+$srcdir+ < $srcdir/Makefile.in >> Makefile
    + echo Linux kernel source tree in directory $srcdir
    + echo Building in directory $dstdir
    +fi
    +

    Gr{oetje,eeting}s,

                                                    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
    In personal conversations with technical people, I call myself a hacker. But
    when I'm talking to journalists I just say "programmer" or something like that.
    							    -- Linus Torvalds
    -
    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/
    

  • Next message: Richard B. Johnson: "RE: spurious 8259A interrupt"

    Relevant Pages

    • [PATCH] out-of-tree builds
      ... Although I like the feature to build a kernel in a different directory a lot, ... The following patch adds a configure script to the kernel. ... echo Building in Linux kernel source tree, ...
      (Linux-Kernel)
    • Re: [kbuild 2/5] Dont use the running kernels config file by default
      ... You grab the version y kernel source tree, ... > for that kernel source tree, ... >> defconfig is not a guarantee for a working kernel either. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: kernel buildsystem broken on RO medium
      ... > How to build external kernel modules using kernel buildsystem from RO medium? ... > Calling toplevel makefile of kernel source tree, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 1/3] 2.6.8-rc4-mm1 - Fix UML build
      ... can access them all, and initialized data all before uninitialized, so ... SYMLINKS:= $,$/$f) ... semaphore.c-dir = kernel ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Real-Time Preemption, -RT-2.6.12-final-V0.7.50-24
      ... > rebooted to a kernel that doesn't have the RT-preempt patch but ... getting a very verbose running trail, almost like an strace output, ... Copyright 2005 by Maurice Eugene Heskett, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)