public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Kai Germaschewski <kai-germaschewski@uiowa.edu>
Cc: Larry McVoy <lm@bitmover.com>,
	"Richard B. Johnson" <root@chaos.analogic.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org, kbuild-devel@lists.sourceforge.net
Subject: Re: [RFC/CFT] Separate obj/src dir
Date: Tue, 19 Nov 2002 22:57:41 +0100	[thread overview]
Message-ID: <20021119215741.GA4308@mars.ravnborg.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0211191444400.24137-100000@chaos.physics.uiowa.edu>

On Tue, Nov 19, 2002 at 02:48:09PM -0600, Kai Germaschewski wrote:
> Wrt the original patch, I like it, one preliminary comment is that I think
> symlinks are nicer than copying. They are faster, shouldn't cause any
> trouble on NFS, make uses "stat" and not "lstat", so it gets the
> timestamps right, too. And if you edit a Makefile/Kconfig in the source
> tree, you rather want that to take effect immediately, I guess ;)

Second try on the script.
Create symlinks as suggested, and optimised find a liitle.

	Sam

#!/bin/sh
#
# This script is used to build a kernel from a separate directory.
# The location of this script is assumed to be the root of
# the kernel tree.
# Usage:
# kernel src located in:
# ~/kernelsrc
# compile in:
# ~/compile
# cd ~/compile   <= Change to the directory where the compile shall take place
# ../kernelsrc/kbuild
#
# Arguments to kbuild is the same as used to make in the kernel build
# kbuild prints out SRCTREE and OBJTREE when started, and then makes a mirror
# of relevant files from the kernelsrc.

# files we do not care about in the kernel src
RCS_FIND_IGNORE="-name SCCS -o -name BitKeeper -o -name .svn -o -name CVS"

OBJTREE=$PWD
cd `dirname $0`
SRCTREE=$PWD
cd $OBJTREE
echo OBJTREE $OBJTREE
echo SRCTREE $SRCTREE
if [ "$SRCTREE" != "$OBJTREE" ]; then
  if [ -f $SRCTREE/.config -o -d $SRCTREE/include/asm ]; then
    echo '$SRCTREE contains generated files, please run "make mrproper" in the SRCTREE'
  else
    for a in `cd $SRCTREE; \
      find \( $RCS_FIND_IGNORE \) -prune -o -name Makefile\* -o -name Kconfig\* -o -name defconfig`; do
      if [ ! -d `dirname $a` ]; then
        mkdir -p $a
      fi
      ln -fs $SRCTREE/$a $a
    done

    ( echo "srctree := $SRCTREE";
      echo "objtree := $OBJTREE";
    ) > .tmp_make_config
    touch Rules.make
  make $*
  fi
else
  rm -f .tmp_make_config
  make $*
fi

  reply	other threads:[~2002-11-19 21:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-19 20:11 [RFC/CFT] Separate obj/src dir Sam Ravnborg
2002-11-19 20:22 ` Richard B. Johnson
2002-11-19 20:29   ` Sam Ravnborg
2002-11-19 20:46     ` Richard B. Johnson
2002-11-19 20:50       ` Kai Germaschewski
2002-11-19 20:54       ` Sam Ravnborg
2002-11-19 21:37         ` David Woodhouse
2002-11-20  4:04           ` Miles Bader
2002-11-19 21:55         ` Brad Hards
2002-11-19 21:01       ` Daniel Jacobowitz
2002-11-19 21:19         ` Geert Uytterhoeven
2002-11-21 16:54       ` Henning P. Schmiedehausen
2002-11-19 20:31   ` Larry McVoy
2002-11-19 20:43     ` Sam Ravnborg
2002-11-19 20:48     ` Kai Germaschewski
2002-11-19 21:57       ` Sam Ravnborg [this message]
2002-11-21 16:53   ` Henning P. Schmiedehausen
2002-11-19 20:51 ` Brian Jackson
2002-11-19 22:05   ` Sam Ravnborg
2002-11-20  6:37   ` Simon Fowler
     [not found]   ` <mailman.1037774521.18360.linux-kernel2news@redhat.com>
2002-11-20  7:06     ` Pete Zaitcev
2002-11-20 13:10 ` [RFC/CFT] " Alex Riesen
2002-11-20 13:14   ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021119215741.GA4308@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=kai-germaschewski@uiowa.edu \
    --cc=kbuild-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm@bitmover.com \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox