help-make
[Top][All Lists]
Advanced

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

RE: What is wrong ?


From: PATTON, BILLY \(SBCSI\)
Subject: RE: What is wrong ?
Date: Fri, 7 Apr 2006 11:56:28 -0500


> -----Original Message-----
> From: Paul Smith [mailto:address@hidden On Behalf Of Paul D. Smith
> Sent: Friday, April 07, 2006 11:22 AM
> To: PATTON, BILLY (SBCSI)
> Cc: address@hidden
> Subject: Re: What is wrong ?
> 
> 
> %% "PATTON, BILLY \(SBCSI\)" <address@hidden> writes:
> 
>   pb> I'm using the gmsl lib to help me with this.
>   pb> define refresh_proj_bb
>   pb> $(1)$(sep)$(2)$(sep)$(3) : $(warning $($(call 
> uc,$(1))$(sep)$(2)$(sep)$(3)))
>   pb> endef
> 
>   pb> $(1) = refresh
>   pb> $(2) = proj 
>   pb> $(3) = bb
>   pb> $(sep) = +
> 
> Eh?  Don't you mean:
> 
>     1 = refresh
>     2 = proj
>     3 = bb
>     sep = +

When I do a $(call refresh_proj_bb,refresh,$(proj),$(bb))
> 
> ?  Also naming these variables "1", "2", and "3" will really 
> confuse you
> when using $(call ...); I strongly urge you to use something else:
> 
>     pre = refresh
>     mid = proj
>     end = bb
>     sep = +
> 
>   pb> If I do:
>   pb> $(warning $(call uc,$(1)))
> 
> Then: $(warning $(call uc,$(pre)))
> 
> etc.
> 
>   pb> I will print REFRESH as expected
> 
>   pb> I have:
>   pb> $(warning $($(call uc,$(1))$(sep)$(2)$(sep)$(3)))
>                 ^^                                   ^
> Why do you have the extra $( ... ) here?
> 
> That means you're taking the result of $(call 
> uc,$(1))$(sep)$(2)$(sep)$(3)
> which is 'REFRESH+proj+bb', and using it as the name of a variable and
> dereferencing it.

That is exactly what I'm trying to do.  And I have manually verified
that that 
variable does exist.

> 
> Assuming you have no variable named REFRESH+proj+bb, that 
> will yield the
> empty string.
> 
>   pb> I wan it to print :
>   pb> REFRESH+proj+bb
> 
> Change to:
> 
>  $(warning $(call uc,$(1))$(sep)$(2)$(sep)$(3))
> 
>   pb> What is wrong?  probably need $$ somewhere :(
> 
> No.  You're going nuts-o with the extra variable 

nuts-o is right :)

> referencing!!  Only use
> it where necessary.  You can't just add them all over the place like
> extra escape sequences :-).
> 
> -- 
> --------------------------------------------------------------
> -----------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://make.paulandlesley.org
>  "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]