From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755860AbXFLPER (ORCPT ); Tue, 12 Jun 2007 11:04:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753800AbXFLPEG (ORCPT ); Tue, 12 Jun 2007 11:04:06 -0400 Received: from rgminet01.oracle.com ([148.87.113.118]:51820 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbXFLPEE (ORCPT ); Tue, 12 Jun 2007 11:04:04 -0400 Date: Tue, 12 Jun 2007 08:04:22 -0700 From: Randy Dunlap To: Oleg Verych Cc: Sam Ravnborg , Rusty Russell , LKML , kbuild-devel@lists.sourceforge.net Subject: Re: [patch] kbuild: remember ARCH in the object directory Message-Id: <20070612080422.988d0da8.randy.dunlap@oracle.com> In-Reply-To: References: <200705090951.l499pa6G020397@shell0.pdx.osdl.net> <20070509204613.GA10336@uranus.ravnborg.org> <1178755780.7286.175.camel@localhost.localdomain> <20070611125903.GA3933@uranus.ravnborg.org> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.3.1 (GTK+ 2.8.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Jun 2007 12:31:56 +0200 Oleg Verych wrote: > [patch] kbuild: remember ARCH in the object directory > > - rephrase some related (misspelled) comments, > - remove all trailing whitespace in the top Makefile, > > * remember ARCH in the output directory, thus making build of i386 > on amd64 *actually* convenient, > > - harmless refactoring of the Makefile generating. > > Signed-off-by: Oleg Verych > --- > > Just lazy typing `make ARCH=i386` every time i want to check lguest. Hi Oleg, So does this only work when O= is used? I had tried to modify Makefile(s) to use the include/asm symlink if it exists, so that 'make ARCH=i386' is not needed after the symlink is created, but I never got that to work. Thanks, this is useful in any case (not yet tested though). > Makefile | 17 ++++++++--------- > scripts/mkmakefile | 42 ++++++++++++++++++++++++------------------ > 2 files changed, 32 insertions(+), 27 deletions(-) > > Index: linux-2.6.22-rc4-mm2/scripts/mkmakefile > =================================================================== > --- linux-2.6.22-rc4-mm2.orig/scripts/mkmakefile 2007-06-12 11:21:27.755466250 +0200 > +++ linux-2.6.22-rc4-mm2/scripts/mkmakefile 2007-06-12 12:04:13.675826250 +0200 > @@ -1,6 +1,6 @@ > -#!/bin/sh > +#!/bin/sh -e > # Generates a small Makefile used in the root of the output > -# directory, to allow make to be started from there. > -# The Makefile also allow for more convinient build of external modules > +# directory, to allow kernel build to be started from there. > +# External modules can't built with it as well. > > # Usage > @@ -9,28 +9,34 @@ > # $3 - version > # $4 - patchlevel > +# $5 - ARCH > > +set -e > > -test ! -r $2/Makefile -o -O $2/Makefile || exit 0 > echo " GEN $2/Makefile" > +echo "# > +# Automatically generated by > +# $0 > +# > +VERSION = $3 > +PATCHLEVEL = $4 > + > +KERNELSRC = $1 > +KERNELOUTPUT = $2 > +ARCH = $5 > +" >$2/Makefile > > -cat << EOF > $2/Makefile > -# Automatically generated by $0: don't edit > +cat << "EOF" >> $2/Makefile > +MAKEFLAGS += -rR --no-print-directory > > -VERSION = $3 > -PATCHLEVEL = $4 > +export ARCH > > -KERNELSRC := $1 > -KERNELOUTPUT := $2 > - > -MAKEFLAGS += --no-print-directory > +all: > + $(MAKE) -C $(KERNELSRC) O=$(KERNELOUTPUT) > > -.PHONY: all \$(MAKECMDGOALS) > +$(filter-out all Makefile,$(MAKECMDGOALS)) %/: > + $(MAKE) -C $(KERNELSRC) O=$(KERNELOUTPUT) $@ > > -all: > - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) > +.PHONY: all $(MAKECMDGOALS) > > Makefile:; > - > -\$(filter-out all Makefile,\$(MAKECMDGOALS)) %/: > - \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@ > EOF --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code ***