bugmake - Bugs: bug #35133, Pattern rules used as dependencies...


bug #35133: Pattern rules used as dependencies for .PRECIOUS don't actually do pattern matching

Submitted by:  None
Submitted on:  Tue 20 Dec 2011 10:17:46 PM UTC  
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.82 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None

Add a New Comment(Rich Markup)

You are not logged in

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


Wed 21 Dec 2011 03:54:55 PM UTC, comment #2:

I can see where it would be an issue with backward compatibility.

At the least, .PRECIOUS should probably have a better description in the documentation to make it more clear that it will only match on a target if the patterns are identical.

Brian Vandenberg <phantal>
Tue 20 Dec 2011 11:22:06 PM UTC, comment #1:

The .PRECIOUS pseudo-target is behaving as documented:

And so are pattern-specific variable assignments:

This is not a bug; the system is behaving as documented.

We can consider changing the behavior of, for example, the .PRECIOUS target so that patterns simply match any target, like other pseudo-targets that take patterns, but we'd have to think very carefully about the backward-compatibility implications of this. I'll leave this open as an enhancement request.

Paul D. Smith <psmith>
Project Administrator
Tue 20 Dec 2011 10:17:46 PM UTC, original submission:

Simple example:

all: some_target_blah.o stuff.o
@echo $@, $<

@echo $@

some_target%.cc : %.y
@echo $@, ${TEST}

@echo $@, ${TEST}

%.o : %.cc
@echo $@, $<

%.cc : TEST := stuff


In the above example, pattern-matching is used in a few different ways; the two I'm drawing attention to in this bug report are #1 and #2.

#1 causes EVERY .cc file to have TEST set. However, in #2, the pattern specified as a dependency of .PRECIOUS only applies to files built using a rule of the form:

%.cc : whatever

Since 'some_target_blah.o' is built using a different pattern, the .PRECIOUS directive doesn't apply to it; thus, make will still try to remove that file when it is finished running.



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

Attach Files:

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 phantal (Posted a comment)
  • -email is unavailable- added by psmith (Posted a comment)

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-20 psmith Item GroupBug => Enhancement

    Back to the top

    Powered by Savane 3.3