public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adjust outputmakefile rule
@ 2006-04-26 13:56 Jan Beulich
  2006-04-30 21:49 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2006-04-26 13:56 UTC (permalink / raw)
  To: sam; +Cc: linux-kernel

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.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

diff -Npru /home/jbeulich/tmp/linux-2.6.17-rc2/Makefile 2.6.17-rc2-mkmakefile/Makefile
--- /home/jbeulich/tmp/linux-2.6.17-rc2/Makefile	2006-04-26 11:50:05.516723552 +0200
+++ 2.6.17-rc2-mkmakefile/Makefile	2006-04-24 12:28:36.000000000 +0200
@@ -344,16 +344,18 @@ 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';                   \
+ifneq ($(KBUILD_SRC),)
+	$(Q)if [ ! -r $(objtree)/Makefile -o -O $(objtree)/Makefile ]; then \
+	    echo '  GEN     $(objtree)/Makefile';                           \
+	    $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile                   \
+		$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)              \
+		> $(objtree)/Makefile;                                      \
 	fi
+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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] adjust outputmakefile rule
  2006-04-26 13:56 [PATCH] adjust outputmakefile rule Jan Beulich
@ 2006-04-30 21:49 ` Sam Ravnborg
  2006-05-02 10:33   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2006-04-30 21:49 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel

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.

Thanks,
	Sam

> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> diff -Npru /home/jbeulich/tmp/linux-2.6.17-rc2/Makefile 2.6.17-rc2-mkmakefile/Makefile
> --- /home/jbeulich/tmp/linux-2.6.17-rc2/Makefile	2006-04-26 11:50:05.516723552 +0200
> +++ 2.6.17-rc2-mkmakefile/Makefile	2006-04-24 12:28:36.000000000 +0200
> @@ -344,16 +344,18 @@ 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';                   \
> +ifneq ($(KBUILD_SRC),)
> +	$(Q)if [ ! -r $(objtree)/Makefile -o -O $(objtree)/Makefile ]; then \
> +	    echo '  GEN     $(objtree)/Makefile';                           \
> +	    $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile                   \
> +		$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)              \
> +		> $(objtree)/Makefile;                                      \
>  	fi
> +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
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] adjust outputmakefile rule
  2006-04-30 21:49 ` Sam Ravnborg
@ 2006-05-02 10:33   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2006-05-02 10:33 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel

>>> Sam Ravnborg <sam@ravnborg.org> 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 <jbeulich@novell.com>

--- /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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-02 10:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26 13:56 [PATCH] adjust outputmakefile rule Jan Beulich
2006-04-30 21:49 ` Sam Ravnborg
2006-05-02 10:33   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox