On Thu, 2010-11-25 at 20:13 -0800, Mark Galeck (CW) wrote:
> C:\Temp>make CFLAGS+=bar
> foo
> make: *** No targets.  Stop.
> 
> In fact, what is happening, make CFLAGS+=bar, behaves exactly like
> make CFLAGS=bar.

Make is interpreting this as "CFLAGS += bar" since += is a valid
assignment operator, just like it would if you wrote "CFLAGS+=bar"
inside a makefile.

> Please explain?  In any case, how to work around this if I want to
> have a variable name with "+" overridden on command line, can I?

Just as you did inside the makefile: add whitespace.  Not sure exactly
how to do this in Windows, but on UNIX systems this gives the right
result:

        make 'CFLAGS+ = bar'

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email protected]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to