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

 
 

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

Submitter:  Andy Goth <andygoth>
Submitted:  Fri 18 May 2007 05:08:14 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Closed.

Paul D. Smith <psmith>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-05-18 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code