[Top][All Lists]

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

Re: What is wrong ?

From: Paul D. Smith
Subject: Re: What is wrong ?
Date: Fri, 7 Apr 2006 12:21:58 -0400

%% "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 
  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 = +

?  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)))


  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.

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 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:            
 "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]