make-alpha
[Top][All Lists]
Advanced

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

Re: Last patch reviewed.


From: Paul Smith
Subject: Re: Last patch reviewed.
Date: Sat, 15 Sep 2007 18:19:42 -0400

On Thu, 2007-09-13 at 15:12 +0000, Boris Kolpackov wrote:
> Yes, it would be great if this is handled properly, e.g.,
> 
> somefile: define foo
>         @echo one
>         @echo two
> endef

Right, this is what I was thinking.  The parser changes will be tricky,
though.

I was also thinking that we could add an optional variable set operator
after the variable name in "define", to change the flavor of the
variable.  I've had many people ask for a way to use "define" but with
a := or ?= flavor.  Something like this:

        define var [operator]
                ...
        endef

If operator were omitted it would default to "=" (just as today), but it
could also be specified as any valid variable setting operator such as
"=" (to be explicit), ":=", "+=", "?=".  So:

        define var :=
                ...
        endef

will create a simple variable "var" with a multi-line value.  Ditto
for ?= and +=.


People have also asked for a way to use "+=" and "?=" with simple
variable assignment; right now they preserve the flavor of the variable
they modify but if it doesn't exist, recursive variables are assumed.
I'm not sure about the syntax for this; maybe "?:=" and "+:=" or
something?  Not sure I like it.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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