bugmake - Bugs: bug #49262, Update match-anything rule...


bug #49262: Update match-anything rule documentation

Submitted by:  Luke Allardyce <lukeallardyce>
Submitted on:  Tue 04 Oct 2016 03:47:00 AM UTC  
Severity:  3 - Normal Item Group:  Documentation
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  None
Fixed Release:  4.3 Triage Status:  None

Add a New Comment (Rich Markup)

You are not logged in

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


Thu 16 Jan 2020 08:30:19 PM UTC, comment #5: 

I added some text similar to the suggested patch.  Thanks!

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Tue 04 Oct 2016 04:34:39 AM UTC, comment #4: 

I thought it might be useful to mention it in the chaining section as well as it is behavior specific to implicit rule chaining.

Luke Allardyce <lukeallardyce>
Tue 04 Oct 2016 04:26:32 AM UTC, comment #3: 

...which is some of the text that you're patching.  Sorry, should have looked at the patch first.

That said, I don't thinking bringing up a particular case in match-any rule processing is helpful in that earlier page about implicit-rules; match-any rules are the particular case while implicit-rules are the general case, so the detail belongs in the description of the former, as it is now.

Calling out being the prerequisite of a implicit-rule blocks non-terminal match-any processing?  Hmm, I was going to say that it's implied by the last paragraph on the page, but that paragraph is too restrictive, implying .SUFFIXES and similar are involved in the creation of the dummy rules.  However, even without dummy rules (as seen in the "-p" output), make will refuse to use a non-terminal match-any rule for a prerequisite.  Something does need to be reworded there.

Tue 04 Oct 2016 04:04:41 AM UTC, comment #2: 

That paragraph doesn't apply to something like

%.o: foo
        @echo $@

        @echo $@

$ make foo.o -R
$ make: *** No rule to make target 'foo.o'.  Stop.

Luke Allardyce <lukeallardyce>
Tue 04 Oct 2016 03:58:53 AM UTC, comment #1: 

I think this is covered in "10.5.5 Match-Anything Pattern Rules"

   If you do not mark the match-anything rule as terminal, then it is
non-terminal.  A non-terminal match-anything rule cannot apply to a
file name that indicates a specific type of data.  A file name
indicates a specific type of data if some non-match-anything implicit
rule target matches it.

   For example, the file name `foo.c' matches the target for the pattern
rule `%.c : %.y' (the rule to run Yacc).  Regardless of whether this
rule is actually applicable (which happens only if there is a file
`foo.y'), the fact that its target matches is enough to prevent
consideration of any non-terminal match-anything rules for the file
`foo.c'.  Thus, `make' will not even consider trying to make `foo.c' as
an executable file from `foo.c.o', `foo.c.c', `foo.c.p', etc.

Tue 04 Oct 2016 03:47:00 AM UTC, original submission:  

I couldn't find anything in the manual that documents the behavior described by the following comment in implicit.c

      /* Rules that can match any filename and are not terminal
         are ignored if we're recursing, so that they cannot be
         intermediate files.  */

Patch is only a suggestion, it'll probably need improvement.

Luke Allardyce <lukeallardyce>


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

Attach Files:

Attached Files
file #38659:  make.patch added by lukeallardyce (2KiB - application/octet-stream)


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 lukeallardyce (Submitted the item)

    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.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-16 psmith StatusNone => Fixed
        Assigned toNone => psmith
        Open/ClosedOpen => Closed
        Fixed ReleaseNone => 4.3
    2016-10-04 lukeallardyce Attached File- => Added make.patch, #38659

    Back to the top

    Powered by Savane 3.7