bugmake - Bugs: bug #37237, Second exapnsion with substitution...

 
 

bug #37237: Second exapnsion with substitution confuse parser:

Submitter:  None
Submitted:  Fri 31 Aug 2012 03:14:56 PM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  None Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 09 Sep 2012 08:06:23 PM UTC, comment #1: 

GNU make's behavior here is correct.  Because the ":" does not appear within a known macro reference (because the "$" is escaped), it's treated as part of the rule.  This makes the rule appear to be a static pattern rule, which is missing a "%", and hence the error.  In other words, make parses this into words as follows: "dir/hello.o", ":", "$$(@F", ":", and ".o=.c)".

To make this work right you need to escape the ":" from make, like so:

dir/hello.o: $$(@F\:.o=.c)


This works in CVS make but I'm not sure it will work in earlier versions; there have been some issues with escaping in target and prerequisite lists.

Paul D. Smith <psmith>
Group administrator
Fri 31 Aug 2012 03:14:56 PM UTC, original submission:  

Example:


.SECONDEXPANSION:
dir/hello.o: $$(@F:.o=.c)
@echo $(@F:.o=.c)


Run:
make -f CCC.mk

Output:
CCC.mk:2: * target pattern contains no `%'.  Stop.

Expected result:
dir/hello.o depends on hello.c



This snipped:
dir/hello.o: $$(@F:.o=.c)

should be equivalent to:
dir/hello.o: $$(patsubst %.c,%.o,$$(@F))

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #28362:  p added by praveenb (139B - application/octet-stream - i run the command make -f p it only printing main_OBJS contents why lib_OBJS not printing please send the details i am trying from last 2 monts)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by praveenb (Updated the item)
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-06-20 praveenb Attached File- Added p, #28362
    2012-09-09 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code