public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ralph Siemsen <ralphs@netwinder.org>
To: trivial@rustcorp.com.au, linux-kernel@vger.kernel.org
Subject: [PATCH] out-of-tree builds: preserve ARCH and CROSS_COMPILE settings
Date: Mon, 07 Feb 2005 17:31:48 -0500	[thread overview]
Message-ID: <4207EC54.8010301@netwinder.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

[I am not subscribed, please CC: any replies]

When you build the 2.6 kernel outside of its source directory, using the 
O= option like so:

	make -C linux-2.6.10 O=../builddir

this conveniently produces a top-level Makefile in "builddir" which can 
be used to update/clean/rebuild the tree with a simple "make".  It also 
uses the ".config" file from "builddir", which makes it very convenient 
for managing multiple builds for different target systems.

However if you are cross-compiling, you must also set ARCH and 
CROSS_COMPILE variables as appropriate.  Unfortunately these settings 
are not recorded in the generated Makefile in "builddir", so one cannot 
simply do "make" anymore.

The attached patch fixes the script that generates the Makefile, so as 
to pass ARCH and CROSS_COMPILE settings, only when they are defined. 
Otherwise behaviour is exactly as it was before.

Since the contents of "builddir" are specific to ARCH and CROSS_COMPILER 
I see no reason why the values should not become fixed in "builddir".

Signed-off-by: Ralph Siemsen <ralphs@netwinder.org>

[-- Attachment #2: mkmakefile.patch --]
[-- Type: text/x-patch, Size: 672 bytes --]

diff -u mkmakefile
--- linux-2.6.10.orig/scripts/mkmakefile	27 Jan 2005 15:53:54 -0000
+++ linux-2.6.10/scripts/mkmakefile	7 Feb 2005 21:20:19 -0000
@@ -9,6 +9,8 @@
 # $3 - version
 # $4 - patchlevel
 
+test "$ARCH" != "" && ARCH="ARCH=$ARCH"
+test "$CROSS_COMPILE" != "" && CROSS="CROSS_COMPILE=$CROSS_COMPILE"
 
 cat << EOF
 # Automatically generated by $0: don't edit
@@ -22,10 +24,10 @@
 MAKEFLAGS += --no-print-directory
 
 all:
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
+	\$(MAKE) $ARCH $CROSS -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
 
 %::
-	\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
+	\$(MAKE) $ARCH $CROSS -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
 
 EOF
 

                 reply	other threads:[~2005-02-07 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4207EC54.8010301@netwinder.org \
    --to=ralphs@netwinder.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@rustcorp.com.au \
    /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