From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932139AbWEBKcd (ORCPT ); Tue, 2 May 2006 06:32:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932155AbWEBKcd (ORCPT ); Tue, 2 May 2006 06:32:33 -0400 Received: from public.id2-vpn.continvity.gns.novell.com ([195.33.99.129]:48433 "EHLO emea1-mh.id2.novell.com") by vger.kernel.org with ESMTP id S932139AbWEBKcc (ORCPT ); Tue, 2 May 2006 06:32:32 -0400 Message-Id: <44575190.76E4.0078.0@novell.com> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Beta Date: Tue, 02 May 2006 12:33:20 +0200 From: "Jan Beulich" To: "Sam Ravnborg" Cc: Subject: Re: [PATCH] adjust outputmakefile rule References: <444F9814.76E4.0078.0@novell.com> <20060430214951.GA22935@mars.ravnborg.org> In-Reply-To: <20060430214951.GA22935@mars.ravnborg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org >>> Sam Ravnborg 30.04.06 23:49 >>> >On Wed, Apr 26, 2006 at 03:56:04PM +0200, Jan Beulich wrote: >> Change the conditional of the outputmakefile rule to be evaluated entirely >> in make, and to not touch the generated makefile when e.g. running >> 'make install' as root while the build was done as non-root. Also adjust >> the comment describing this. > >Can I request you to redo this patch. >Move all logic (including print-out) to mkmakefile >And only let it print out "GEN ...." when it actttttttually generate >the Makefile. Here we go: Change the conditional of the outputmakefile rule to be evaluated entirely in make, and add a conditional to not touch the generated makefile when e.g. running 'make install' as root while the build was done as non-root. Also adjust the comment describing this, and move the message printing and redirection to mkmakefile. Signed-off-by: Jan Beulich --- /home/jbeulich/tmp/linux-2.6.17-rc3/Makefile 2006-04-27 17:49:26.000000000 +0200 +++ 2.6.17-rc3-mkmakefile/Makefile 2006-04-24 12:28:36.000000000 +0200 @@ -344,16 +344,14 @@ scripts_basic: scripts/basic/%: scripts_basic ; PHONY += outputmakefile -# outputmakefile generate a Makefile to be placed in output directory, if -# using a seperate output directory. This allows convinient use -# of make in output directory +# outputmakefile generates a Makefile in the output directory, if using a +# separate output directory. This allows convenient use of make in the +# output directory. outputmakefile: - $(Q)if test ! $(srctree) -ef $(objtree); then \ - $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ - $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ - > $(objtree)/Makefile; \ - echo ' GEN $(objtree)/Makefile'; \ - fi +ifneq ($(KBUILD_SRC),) + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ + $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) +endif # To make sure we do not include .config for any of the *config targets # catch them early, and hand them over to scripts/kconfig/Makefile --- /home/jbeulich/tmp/linux-2.6.17-rc3/scripts/mkmakefile 2006-04-27 17:49:57.000000000 +0200 +++ 2.6.17-rc3-mkmakefile/scripts/mkmakefile 2006-05-02 11:27:13.000000000 +0200 @@ -10,7 +10,10 @@ # $4 - patchlevel -cat << EOF +test ! -r $2/Makefile -o -O $2/Makefile || exit 0 +echo " GEN $2/Makefile" + +cat << EOF > $2/Makefile # Automatically generated by $0: don't edit VERSION = $3