[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-21 Thread Paul D. Smith
Follow-up Comment #6, bug #60188 (project make):

For #1, I tend write my own completely different pattern rules with unused
suffixes like ".x" or ".z" or whatever, rather than try to re-use built-in
pattern rules.

Thanks I'll look at the test.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-20 Thread Dmitry Goncharov
Follow-up Comment #5, bug #60188 (project make):

Paul, i attached one more test
 sv60188_explicit_intermediate_test.diff.

This one tests that an explicitly mentioned file is still intermediate when it
is a prereq to .INTERMEDIATE.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-20 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_explicit_intermediate_test.diff Size:0 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-20 Thread Dmitry Goncharov
Follow-up Comment #4, bug #60188 (project make):

Thank you, Paul.
1. Do you mean something like
CC="@echo cc"
?

2. sure

3. By the old style do you mean run_make_with_options?

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-15 Thread Paul D. Smith
Update of bug #60188 (project make):

  Status:None => Fixed  
 Open/Closed:Open => Closed 
   Component Version: SCM => 4.3
Operating System:None => Any
   Fixed Release:None => SCM
   Triage Status:None => Medium Effort  

___

Follow-up Comment #3:

Thanks for those changes Dmitry.  I applied them mostly as-is.

Especially thanks for the tests!  For the future a few notes about tests:

1) Unless you're trying to test the built-in rules, it's best to not use any
of them in the tests and instead define your own.  The problem is that the
output of the built-in rules might be different on different platforms (for
example the default compiler might be named something different) then the
tests will fail.

2) I prefer to avoid adding TAB characters into my test rules unless they are
really required, and instead use the ";" separator to put the entire rule one
one line.  Otherwise, it's easy for editors which convert TAB to space in Perl
code (which is common) to corrupt the test files when they're edited.

3) The tests available represent a significant evolution over time so the
older tests and older test methods should be avoided; someday all the tests
should be rewritten to use the modern syntax but in any event we should avoid
adding more old-style tests even to test files that haven't been updated yet
(the tests you provided here are all new-style so that's good, just FYI).

Cheers!

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-08 Thread Paul D. Smith
Follow-up Comment #2, bug #60188 (project make):

I agree this is a bug.  Thanks Dmitry I'll look at these fixes.

Now that your paperwork is (finally) complete I owe you a lot of patch reviews
/ applications.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Follow-up Comment #1, bug #60188 (project make):

sv60188_explicit_file_built_by_implicit_rule_is_not_intermediate.diff contains
a fix.


All other attached patches contain new tests.
Even though the fix is not related to static pattern rules, i added a test for
static pattern rules to cover all such situations.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_se_implicit_test.diff  Size:1 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_grouped_targets_test.diff Size:0 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_statipattrules_test.diff Size:0 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_double_colon_test.diff Size:0 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name: sv60188_patternrules_test.diff Size:2 KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
Additional Item Attachment, bug #60188 (project make):

File name:
sv60188_explicit_file_built_by_implicit_rule_is_not_intermediate.diff Size:5
KB
   




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[bug #60188] Explicit file built by an implicit rule is not intermediate.

2021-03-07 Thread Dmitry Goncharov
URL:
  

 Summary: Explicit file built by an implicit rule is not
intermediate.
 Project: make
Submitted by: dgoncharov
Submitted on: Sun 07 Mar 2021 07:02:23 PM UTC
Severity: 3 - Normal
  Item Group: Bug
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any
   Component Version: SCM
Operating System: None
   Fixed Release: None
   Triage Status: None

___

Details:

Make incorrectly considers an explicit file built by an implicit rule as
intermediate.

$ cat makefile
%.z: test.x
touch $@

%.x: ;
$ touch hello.z
$ rm test.x
rm: cannot remove 'test.x': No such file or directory
$ make hello.z
make: 'hello.z' is up to date.

This is the relevant part of make -d output

Considering target file 'hello.z'.
 Looking for an implicit rule for 'hello.z'.
 Trying pattern rule with stem 'hello'.
 Trying rule prerequisite 'test.x'.
 Trying pattern rule with stem 'hello'.
 Trying rule prerequisite 'test.x'.
 Looking for a rule with intermediate file 'test.x'.
  Avoiding implicit rule recursion.
  Trying pattern rule with stem 'test'.
 Found an implicit rule for 'hello.z'.
 Finished prerequisites of target file 'hello.z'.
 Prerequisite 'test.x' of target 'hello.z' does not exist.
No need to remake target 'hello.z'.


make considers test.x an intermediate and does not build hello.z.
test.x should not be considered intermediate, because test.x is explicitly
mentioned.




___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/