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: Mark Galeck (CW)
Subject: RE: argument 'v=x' does not appear to work as in the manual ?
Date: Fri, 26 Nov 2010 00:27:27 -0800

Well...

I quoted for you the exact wording from the manual, it says precisely, if there 
is a = in the option, then the left of the = is interpreted as the variable 
name, and the right of the = is the value.  There is no mention of any +=.  

There is never anywhere in the manual, any mention of += being used on the 
command line.  The only mention of variables on command line, is what I quoted, 
in conjunction with "=", never with "+="  .


Yes I know I can quote this thing, but I wanted to "implement" the += operator 
on the command line, you see.

Currently in fact, this is not working as "assignment operator", as you seem to 
be saying, the following should yield "foo bar", it does not.  

CFLAGS = foo
$(info $(CFLAGS))

> C:\Temp>make  CFLAGS+=bar
bar


It appears that in fact
>make CFLAGS+=bar
Behaves just like
>make CFLAGS=bar


So, if I understand you correctly, then A) there should be a mention in the 
manual where it talks about command line assignments, that "+=" may be used 
also, with the expected result, and B) the expected result is that the value of 
CFLAGS from the makefile, is appended with whatever we put on the command line.

Well, then now it appears that both:  it's not working exactly as it's written 
in the manual, and it's also not working as you intended it to be.  

Please comment if and where I am going wrong here.


So that's why, I actually "implemented" +=, the way you seem to intend to be, 
by fooling around with Windows shell in the make wrapper.  


By the way, when somebody disagrees with me on makefiles, I say "Paul Smith 
would do it this way".  I hope you don't mind :)  

Mark  



-----Original Message-----
From: Paul Smith [mailto:address@hidden 
Sent: Friday, November 26, 2010 12:09 AM
To: Mark Galeck (CW)
Cc: address@hidden
Subject: Re: argument 'v=x' does not appear to work as in the manual ?

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.




reply via email to

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