bugmake - Bugs: bug #19900, Target-specific variables not...

 
 

bug #19900: Target-specific variables not honored for rules generated by $(eval)

Submitted by:  Andy Goth <andygoth>
Submitted on:  Fri 18 May 2007 05:08:14 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 18 May 2007 09:16:36 PM UTC, comment #3:

Closed.

Paul D. Smith <psmith>
Project Administrator
Fri 18 May 2007 06:43:54 PM UTC, comment #2:

My apologies. The problem was my misunderstanding.

In the $(eval) case, $(var) was being expanded as part of the $(eval), which isn't being done in the context of a rule. Using $$(var) fixes this because $(eval) generates a rule containing the string "$(var)", and expansion is deferred until the rule is applied.

Sorry for wasting your time with this; just close the bug. And thanks for pointing me in the right direction.

Andy Goth <andygoth>
Fri 18 May 2007 05:24:59 PM UTC, comment #1:

See the note about double expansion here:

http://www.gnu.org/software/make/manual/make.html#Eval-Function

You want the rule to read:

echo $$(var)

That then works for me.

Martin Dorey <mdorey>
Fri 18 May 2007 05:08:14 PM UTC, original submission:

Target-specific and pattern-specific variables don't seem to work within rules generated with the $(eval) function.

Sample Makefile without $(eval):

var := bad
all: var := good
all:
@echo $(var)

Running this will cause "good" to be printed.

Sample Makefile with $(eval):

var := bad
all: var := good
define template
all:
@echo $(var)
endef
$(eval $(template))

Running this will cause "bad" to be printed.

Andy Goth <andygoth>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by mdorey (Posted a comment)
  • -unavailable- added by andygoth (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 18 May 2007 09:16:36 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1