bugmake - Bugs: bug #51167, Pattern rule with no recipe fails

 
 

bug #51167: Pattern rule with no recipe fails

Submitter:  None
Submitted:  Fri 02 Jun 2017 09:48:43 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.1 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 02 Jun 2017 09:54:21 PM UTC, comment #1: 

This is defined behavior.  It is not possible to create a pattern rule that has no recipe.

See https://www.gnu.org/software/make/manual/html_node/Canceling-Rules.html

Paul D. Smith <psmith>
Group administrator
Fri 02 Jun 2017 09:48:43 PM UTC, original submission:  

It appears that pattern rules don't work at all if they don't have a body (recipe), even if they do have dependencies and thus aren't no-ops.


$ echo 'foo-%:' >Makefile; make foo-x
make: *** No rule to make target 'foo-x'.  Stop.
$ printf 'bar-%%:\n\t@echo bar $*\n\nfoo-%%: bar-%%\n' >Makefile; make bar-x; make foo-x
bar x
make: *** No rule to make target 'foo-x'.  Stop.
$



Anonymous

 

(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)
  •  

    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
    2017-06-02 psmith StatusNone Not A Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code