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

 
 

bug #37237: Second exapnsion with substitution confuse parser:

Submitted by:  None
Submitted on:  Fri 31 Aug 2012 03:14:56 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: NoneOperating System: None
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.

 

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:

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>
Project 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 File(s):
   
   
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
  • -unavailable- added by praveenb (Updated the item)
  • -unavailable- added by psmith (Posted a comment)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 20 Jun 2013 10:20:21 AM UTCpraveenbAttached File-=>Added p, #28362
    Sun 09 Sep 2012 08:06:23 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1