bugmake - Bugs: bug #31621, interaction of pattern rules and...

 
 

bug #31621: interaction of pattern rules and globs

Submitter:  Petr Machata <pmachata>
Submitted:  Thu 11 Nov 2010 03:39:36 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.0 Operating System:  None
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 22 Sep 2013 08:18:49 PM UTC, comment #4: 

I can reproduce this with GNU make 3.82; however it is working properly for me with the current release candidate for the next release of GNU make, so this problem has been fixed.

Paul D. Smith <psmith>
Group administrator
Fri 29 Jul 2011 11:15:37 AM UTC, comment #3: 

One solution is to enable second expansion and to use the $(wildcard ...) function:


$ cat x.mk
.SECONDEXPANSION:

%/md5: $$(wildcard %/sums/*.md5)
        echo action



Anonymous
Fri 29 Jul 2011 10:38:30 AM UTC, comment #2: 

This is a regression introduced in make-3.82.
make-3.81 handles this wihtout problems.

Directory names build from patterns seem to prevent wildcard expansion.

Anonymous
Thu 11 Nov 2010 03:40:21 PM UTC, comment #1: 

Forgot to post this:

$ cat x.mk
%/md5: %/sums/*.md5
        echo action


Petr Machata <pmachata>
Thu 11 Nov 2010 03:39:36 PM UTC, original submission:  

make doesn't seem to like pattern rule prerequisites that use globs.  I found no reference in the manual that states that this should be supported, so I don't actually know if what I'm asking for is a bug fix or enhancement.  Anyway:


$ find xxx
xxx
xxx/sums
xxx/sums/zzz.md5
$ make -rd -f x.mk xxx/md5
Reading makefiles...
Reading makefile `x.mk'...
# the following are my two debug printfs
-> parse_file_seq %/md5
-> parse_file_seq %/sums/*.md5
Updating makefiles....
<--- snip --->
Updating goal targets....
Considering target file `xxx/md5'.
 File `xxx/md5' does not exist.
 Looking for an implicit rule for `xxx/md5'.
 Trying pattern rule with stem `xxx'.
 Trying implicit prerequisite `xxx/sums/*.md5'.
 Trying pattern rule with stem `xxx'.
 Trying implicit prerequisite `xxx/sums/*.md5'.
 Looking for a rule with intermediate file `xxx/sums/*.md5'.
  Avoiding implicit rule recursion.
 No implicit rule found for `xxx/md5'.
 Finished prerequisites of target file `xxx/md5'.
Must remake target `xxx/md5'.
make: *** No rule to make target `xxx/md5'.  Stop.


... the problem being that the wildcard expansion takes place in read.c:parse_file_seq, when reading the makefile.  That doesn't find any file matching the %/... path, so it leaves the wild card as is, and later after the stem-replacement, make looks for xxx/sums/*.md5.

Petr Machata <pmachata>

 

(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 pmachata (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
    2013-09-22 psmith StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code