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

2011-12-21 Thread Brian Vandenberg
Follow-up Comment #2, bug #35133 (project make):

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.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


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

2011-12-20 Thread Paul D. Smith
Update of bug #35133 (project make):

  Item Group: Bug => Enhancement

___

Follow-up Comment #1:

The .PRECIOUS pseudo-target is behaving as documented:


You can also list the target pattern of an implicit rule (such as
`%.o') as a prerequisite file of the special target `.PRECIOUS' to
preserve intermediate files created by rules whose target patterns
match that file's name.


And so are pattern-specific variable assignments:


In addition to target-specific variable values, GNU `make'
supports pattern-specific variable values.  In this form, the
variable is defined for any target that matches the pattern
specified.


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.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


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

2011-12-20 Thread anonymous
URL:
  

 Summary: Pattern rules used as dependencies for .PRECIOUS
don't actually do pattern matching
 Project: make
Submitted by: None
Submitted on: Tue 20 Dec 2011 10:17:46 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: 3.82
Operating System: POSIX-Based
   Fixed Release: None
   Triage Status: None

___

Details:

Simple example:

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

%.y:
  @echo $@

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

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

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

#1
%.cc : TEST := stuff

#2
.PRECIOUS: %.cc
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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.





___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make