help-make
[Top][All Lists]
Advanced

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

Re: argument 'v=x' does not appear to work as in the manual ?


From: Paul Smith
Subject: Re: argument 'v=x' does not appear to work as in the manual ?
Date: Fri, 26 Nov 2010 03:08:44 -0500

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 <address@hidden>          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




reply via email to

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