Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] allow CROSS_COMPILE override
@ 2003-02-20 20:47 Jun Sun
  2003-02-20 21:15 ` Brian Murphy
  2003-02-20 21:57 ` Daniel Jacobowitz
  0 siblings, 2 replies; 9+ messages in thread
From: Jun Sun @ 2003-02-20 20:47 UTC (permalink / raw)
  To: linux-mips; +Cc: jsun

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

Anybody would object this?  It allows one to override
CROSS_COMPILE from command line or top-level Makefile.

Jun


[-- Attachment #2: 030220.b-2.4-allow-CROSS_COMPILE-override.patch --]
[-- Type: text/plain, Size: 345 bytes --]

diff -Nru linux/arch/mips/Makefile.orig linux/arch/mips/Makefile
--- linux/arch/mips/Makefile.orig	Thu Feb 20 10:49:18 2003
+++ linux/arch/mips/Makefile	Thu Feb 20 12:18:53 2003
@@ -23,7 +23,9 @@
 endif
 
 ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE	= $(tool-prefix)
+  ifndef CROSS_COMPILE
+    CROSS_COMPILE	= $(tool-prefix)
+  endif
 endif
 
 #

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 20:47 [PATCH] allow CROSS_COMPILE override Jun Sun
@ 2003-02-20 21:15 ` Brian Murphy
  2003-02-20 21:23   ` Jun Sun
  2003-02-20 21:57 ` Daniel Jacobowitz
  1 sibling, 1 reply; 9+ messages in thread
From: Brian Murphy @ 2003-02-20 21:15 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

Jun Sun wrote:

>Anybody would object this?  It allows one to override
>
Why not but this is less messy:

--- arch/mips/Makefile  13 Dec 2002 23:41:09 -0000      1.1.1.8
+++ arch/mips/Makefile  20 Feb 2003 21:10:30 -0000
@@ -23,7 +23,7 @@
 endif
 
 ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE  = $(tool-prefix)
+CROSS_COMPILE ?= $(tool-prefix)
 endif
 
 #

/Brian

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 21:15 ` Brian Murphy
@ 2003-02-20 21:23   ` Jun Sun
  2003-02-20 21:35     ` Brian Murphy
  2003-02-20 22:03     ` Brian Murphy
  0 siblings, 2 replies; 9+ messages in thread
From: Jun Sun @ 2003-02-20 21:23 UTC (permalink / raw)
  To: Brian Murphy; +Cc: linux-mips, jsun


Is this allowed?  Can't find any such usage in kernel other
than the worrisome comment below:

arch/arm/Makefile:# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?


Jun

On Thu, Feb 20, 2003 at 10:15:06PM +0100, Brian Murphy wrote:
> Jun Sun wrote:
> 
> >Anybody would object this?  It allows one to override
> >
> Why not but this is less messy:
> 
> --- arch/mips/Makefile  13 Dec 2002 23:41:09 -0000      1.1.1.8
> +++ arch/mips/Makefile  20 Feb 2003 21:10:30 -0000
> @@ -23,7 +23,7 @@
>  endif
>  
>  ifdef CONFIG_CROSSCOMPILE
> -CROSS_COMPILE  = $(tool-prefix)
> +CROSS_COMPILE ?= $(tool-prefix)
>  endif
>  
>  #
> 
> /Brian
> 

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 21:23   ` Jun Sun
@ 2003-02-20 21:35     ` Brian Murphy
  2003-02-20 21:57       ` Pete Popov
  2003-02-20 22:03     ` Brian Murphy
  1 sibling, 1 reply; 9+ messages in thread
From: Brian Murphy @ 2003-02-20 21:35 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

Jun Sun wrote:

>Is this allowed?  Can't find any such usage in kernel other
>than the worrisome comment below:
>
>arch/arm/Makefile:# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
>  
>
>  
>
It worked for me when I tested the patch, at least for this simple case.
Might have something to do with the make version, when was the comment
written?

brm@brian:~$ make -v
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.

/Brian

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 21:35     ` Brian Murphy
@ 2003-02-20 21:57       ` Pete Popov
  0 siblings, 0 replies; 9+ messages in thread
From: Pete Popov @ 2003-02-20 21:57 UTC (permalink / raw)
  To: Brian Murphy; +Cc: Jun Sun, linux-mips

On Thu, 2003-02-20 at 13:35, Brian Murphy wrote:
> Jun Sun wrote:
> 
> >Is this allowed?  Can't find any such usage in kernel other
> >than the worrisome comment below:
> >
> >arch/arm/Makefile:# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
> >  
> >
> >  
> >
> It worked for me when I tested the patch, at least for this simple case.
> Might have something to do with the make version, when was the comment
> written?
> 
> brm@brian:~$ make -v
> GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.

I know for a fact that this syntax works for me on RH7.3 because we use
it heavily in a bunch of tools makefiles.

Pete

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 20:47 [PATCH] allow CROSS_COMPILE override Jun Sun
  2003-02-20 21:15 ` Brian Murphy
@ 2003-02-20 21:57 ` Daniel Jacobowitz
  2003-02-20 22:06   ` Brian Murphy
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Jacobowitz @ 2003-02-20 21:57 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

On Thu, Feb 20, 2003 at 12:47:03PM -0800, Jun Sun wrote:
> Anybody would object this?  It allows one to override
> CROSS_COMPILE from command line or top-level Makefile.
> 
> Jun
> 

Silly question: why does this matter if CROSS_COMPILE is on the command
line?  Command line definitions override anything in the makefile.  Is
it falling off the command line in a recursive make?

> diff -Nru linux/arch/mips/Makefile.orig linux/arch/mips/Makefile
> --- linux/arch/mips/Makefile.orig	Thu Feb 20 10:49:18 2003
> +++ linux/arch/mips/Makefile	Thu Feb 20 12:18:53 2003
> @@ -23,7 +23,9 @@
>  endif
>  
>  ifdef CONFIG_CROSSCOMPILE
> -CROSS_COMPILE	= $(tool-prefix)
> +  ifndef CROSS_COMPILE
> +    CROSS_COMPILE	= $(tool-prefix)
> +  endif
>  endif
>  
>  #


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 21:23   ` Jun Sun
  2003-02-20 21:35     ` Brian Murphy
@ 2003-02-20 22:03     ` Brian Murphy
  2003-02-21  0:08       ` Jun Sun
  1 sibling, 1 reply; 9+ messages in thread
From: Brian Murphy @ 2003-02-20 22:03 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

Jun Sun wrote:

>Is this allowed?  Can't find any such usage in kernel other
>than the worrisome comment below:
>
>arch/arm/Makefile:# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
>
>
>  
>
The arm code does this:

# Only set INCDIR if its not already defined above
# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
ifeq ($(origin INCDIR), undefined)
INCDIR          := $(MACHINE)
endif

where the make docs say:

INCDIR ?= $(MACHINE)

is the same as

ifeq ($(origin INCDIR), undefined)
INCDIR          = $(MACHINE)
endif

which means INCDIR will reflect changes to MACHINE.
The := form sets INCDIR once and for all. What do you want?
I can't see that this should be a problem in the arm makefile.
Perhaps I'm missing something.

/Brian

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 21:57 ` Daniel Jacobowitz
@ 2003-02-20 22:06   ` Brian Murphy
  0 siblings, 0 replies; 9+ messages in thread
From: Brian Murphy @ 2003-02-20 22:06 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: linux-mips

Daniel Jacobowitz wrote:

>Silly question: why does this matter if CROSS_COMPILE is on the command
>line?  Command line definitions override anything in the makefile.  Is
>it falling off the command line in a recursive make?
>  
>
You need ?= to allow the define in the top level makefile to override 
that in
the sub-makefile. You also need it if you want to get the value from an
environment variable and not from something like this:

make CROSS_COMPILE=xxx

which is the only case where it works now.

/Brian

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

* Re: [PATCH] allow CROSS_COMPILE override
  2003-02-20 22:03     ` Brian Murphy
@ 2003-02-21  0:08       ` Jun Sun
  0 siblings, 0 replies; 9+ messages in thread
From: Jun Sun @ 2003-02-21  0:08 UTC (permalink / raw)
  To: Brian Murphy; +Cc: linux-mips, jsun

On Thu, Feb 20, 2003 at 11:03:38PM +0100, Brian Murphy wrote:
> Jun Sun wrote:
> 
> >Is this allowed?  Can't find any such usage in kernel other
> >than the worrisome comment below:
> >
> >arch/arm/Makefile:# Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
> >
> >
> >  
> >
> The arm code does this:
> 
> # Only set INCDIR if its not already defined above
> # Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
> ifeq ($(origin INCDIR), undefined)
> INCDIR          := $(MACHINE)
> endif
> 
> where the make docs say:
> 
> INCDIR ?= $(MACHINE)
> 
> is the same as
> 
> ifeq ($(origin INCDIR), undefined)
> INCDIR          = $(MACHINE)
> endif
> 
> which means INCDIR will reflect changes to MACHINE.
> The := form sets INCDIR once and for all. What do you want?

':=' is fine, as long as "?=" is deemed appropriate for kernel and hackers.

Jun

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

end of thread, other threads:[~2003-02-21  0:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-20 20:47 [PATCH] allow CROSS_COMPILE override Jun Sun
2003-02-20 21:15 ` Brian Murphy
2003-02-20 21:23   ` Jun Sun
2003-02-20 21:35     ` Brian Murphy
2003-02-20 21:57       ` Pete Popov
2003-02-20 22:03     ` Brian Murphy
2003-02-21  0:08       ` Jun Sun
2003-02-20 21:57 ` Daniel Jacobowitz
2003-02-20 22:06   ` Brian Murphy

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