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:44:28 -0800

Here's the WHOLE STORY

What users wanted me to do, is to give them the ability to type

>make CFLAGS+=-foo

and what that would do, is add the value specified, to the value of CFLAGS 
already in the makefile (I guess, speaking precisely, as it is at the end of 
the fist pass of the make).


So what I did, is first I read the manual, it said, "=" on command line behaves 
so-and-so.  Never any mention of "+=".  So I thought 
>make CFLAGS+=-foo

even though for the user it would appear as if I am adding -foo to CFLAGS, in 
fact, from the exact reading of the manual, it would actually be CFLAGS+ = -foo
and then I could do

CFLAGS += $(CFLAGS+)

in the makefile, and be done with it.  Neat trick, eh?


But Paul seems to be saying, the manual should also say about += in fact.  
That's OK, even better, no need for the tricks, it would just work directly 
without me having to do any work.  I like that!  But it does not seem to work 
that way either.  


So I had to implement this in the Windows wrapper for make, where I replace + 
with "P", and then pass that to make etc etc.  Works like a charm, except I 
like to put as little as possible in the wrapper, and as much as possible in 
the makefile.  

  

Mark  

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

> From: Paul Smith <address@hidden>
> Date: Fri, 26 Nov 2010 03:08:44 -0500
> Cc: "address@hidden" <address@hidden>
> 
> > 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

Like so:

        make "CFLAGS+ = bar"



reply via email to

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