mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [CFT] Separate obj dir [2]
Date: Sun, 24 Nov 2002 08:09:41 +0100	[thread overview]
Message-ID: <20021124070941.GA1121@mars.ravnborg.org> (raw)
In-Reply-To: <20021123222259.GA10609@mars.ravnborg.org>

Hi all.

I the previous mail I forgot the kbuild script - sorry.
Here it comes (as a patch).

	Sam

--- /dev/null	2002-08-31 01:31:37.000000000 +0200
+++ kbuild	2002-11-24 08:06:33.000000000 +0100
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# This script is used to build a kernel from a directory
+# separate from the kernel src tree.
+# The location of this script is assumed to be the root of
+# the kernel src tree. Do not copy it elsewhere.
+# Usage: kbuild [Usual options provided to make]
+
+# kbuild prints out SRCTREE and OBJTREE when started, and then makes 
+# symlinks 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"
+
+# Obtain absolute paths for SRCTREE and OBJTREE
+OBJTREE=$PWD
+cd `dirname $0`
+SRCTREE=$PWD
+cd $OBJTREE
+echo OBJTREE $OBJTREE
+echo SRCTREE $SRCTREE
+
+# If kbuild is executed from the root of the kernel src tree just call make
+if [ "$SRCTREE" == "$OBJTREE" ]; then
+  rm -f .tmp_make_config
+  make $*
+else
+  # A directory separate from kernel src tree
+  # Test if make has been executed in kernel src tree already
+  if [ -f $SRCTREE/.config -o -d $SRCTREE/include/asm ]; then
+    echo '$SRCTREE contains generated files, please run "make mrproper" in the SRCTREE'
+  else
+    # Symlink relevant files
+    for a in `cd $SRCTREE; \
+      find \( $RCS_FIND_IGNORE \) -prune -o -name Makefile\*`; 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
+    echo "#Dummy file" > Rules.make
+    make $*
+  fi
+fi

      reply	other threads:[~2002-11-24  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-23 22:22 Sam Ravnborg
2002-11-24  7:09 ` Sam Ravnborg [this message]

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=20021124070941.GA1121@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®