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


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to