tiger-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tiger-devel] [PATCH] my last makefile patch was bad ... sorry.


From: Nicolas François
Subject: Re: [Tiger-devel] [PATCH] my last makefile patch was bad ... sorry.
Date: Sun, 14 Sep 2003 03:33:43 +0200
User-agent: Mutt/1.5.4i

Hi!

On Thu, Sep 11, 2003 at 07:25:59AM -0700, Paul Telford wrote:
> On 10 Sep 2003, Ryan Bradetich wrote:
>
> > P.S. the := assignment for PLATFORM_SCRIPTS breaks on HP-UX,
> > not sure why.  Changing the assignment to = fixes the problem.  Anyone
> > know the difference between = and :=?
> 
> On a Linux machine, 'info make' on has the details in the "Setting
> Variables" section:
> 
>  Variables defined with `=' are "recursively expanded" variables.
>  Variables defined with `:=' are "simply expanded" variables; these
>  definitions can contain variable references which will be expanded
>  before the definition is made.

The section "The Two Flavors of Variables" is more detailed on this:
http://www.gnu.org/manual/make/html_node/make_63.html#SEC67

For example:
This Makefile

    bar1 = bar
    foo1 = $(bar1)
    bar1 = bar1

    bar2 = barbar
    foo2 := $(bar2)
    bar2 = bar2

    all:;echo "$(foo1)"; echo "$(foo2)"
    
    bar1 = bar1_after
    bar2 = bar2_after

will produce:
$ make
bar1_after
barbar


foo1 is expanded when the target all is executed, and all the Makefile
parsed
foo2 is expanded "at the line foo2 is written"


For the tiger's Makefile, an '=' will do the same as ':=' because the
'system' directory is not modified by any target and PLATFORM_SCRIPTS is
never redefined.

I tested it on a linux box, and a simple '=' works as expected.

hth
-- 
Nekral




reply via email to

[Prev in Thread] Current Thread [Next in Thread]