bugmake - Bugs: bug #51311, Checking search retries for...

 
 

bug #51311: Checking search retries for implicit make rules

Submitter:  Markus Elfring <elfring>
Submitted:  Sun 25 Jun 2017 07:40:47 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Duplicate Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.2.1 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 02 Jul 2017 06:03:46 PM UTC, comment #4: 


> In fact there can be zero, one, or as many prerequisites containing the pattern character as you like. Essentially if the target contains a pattern character then it's a pattern rule:


Can examples in the manual cause the impression that there is any limitation?


>…, the reason your example doesn't work is that a pattern character must match at least one character.


Can this information appear in another section of the manual?

Do I need to pair standard pattern rules with concrete make rules so that the placeholder “%” will be handled in special cases as if it would be optional?

I am curious on how the software will evolve further for the previous clarification request “pattern rules: % doesn't match empty string” then.

Markus Elfring <elfring>
Sun 02 Jul 2017 05:25:41 PM UTC, comment #3: 

As pointed out on the mailing list, it's not true that there can only be one prerequisite containing the pattern character (%).  In fact there can be zero, one, or as many prerequisites containing the pattern character as you like.  Essentially if the target contains a pattern character then it's a pattern rule: the prerequisites list doesn't matter.

As Mike points out, the reason your example doesn't work is that a pattern character must match at least one character.

As for allowing pattern characters to match zero characters, that is already filed as an enhancement request as bug #29448 so we don't need another one.

Paul D. Smith <psmith>
Group administrator
Mon 26 Jun 2017 08:18:01 AM UTC, comment #2: 

From Mike Gran:
“…
So your interpretation is incorrect.
…”

I find that the documentation can be clarified a bit more on this aspect.

I propose another software extension then.


From Mike Gran:
“…
It needs to match at least a single character,
…”

I would appreciate to use a placeholder which can occasionally also be resolved to the empty string at the discussed script place.

Markus Elfring <elfring>
Sun 25 Jun 2017 08:54:20 PM UTC, comment #1: 

Markus,

You've opened this as a bug. I believe it is not a bug.  Again. I'm not a maintainer.

Please note two things.

1. while "MOTD%.log: MOTD%.txt" is a pattern rule, "MOTD%.log: MOTD%.txt MOTD%.in" is not a pattern rule, because it has two entries after the colon.  So your interpretation is incorrect.

2. The '%' (the stem) in a pattern rule doesn't, if I recall correctly, match a null string.  It needs to match at least a single character, so building MOTD.log won't work.

Mike Gran <mike121>
Sun 25 Jun 2017 07:40:47 PM UTC, original submission:  

The documentation contains the following information:
“…
Any target in the makefile may be specified as a goal (…). Even targets not in the makefile may be specified, if make can find implicit rules that say how to make them.
…”


my_info?=echo
my_compilation?=echo
my_preparation?=cat
footer?=MOTD.txt
prepared_file?=MOTD.in

MOTD.info: ${footer}
        ${my_info} "$(shell date): Is this acceptable?: $(shell cat ${footer})" > $@

MOTD%.log: MOTD%.txt MOTD%.in
        ${my_compilation} "$<: $(shell cat ${prepared_file} ${footer})" > $@

${prepared_file}: MOTD.draft
        ${my_preparation} $< > $@


Test result:

elfring@Sonne:~/Projekte/Bau> LANG=C make --no-builtin-rules -f ../GNU/make/rule-check3.make -d MOTD.log

Updating goal targets....
Considering target file 'MOTD.log'.
 File 'MOTD.log' does not exist.
 Looking for an implicit rule for 'MOTD.log'.
 No implicit rule found for 'MOTD.log'.
 Finished prerequisites of target file 'MOTD.log'.
Must remake target 'MOTD.log'.
make: *** No rule to make target 'MOTD.log'.  Stop.



I would interpret the second rule as a make pattern rule which is also categorised as an implicit rule then. An explicit make rule does not exist in this small test example for the specified (non-default) goal. So I would expect that another search try will be performed.
Why do I observe a mismatch there?

How much does it matter in this test case that I would like to try a prerequisite out which should contain two “patterns”?

Markus Elfring <elfring>

 

(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 mike121 (Posted a comment)
  • -email is unavailable- added by elfring (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
    2017-07-02 psmith StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code