bugmake - Bugs: bug #52017, Multiple intermediate pattern...

 
 

bug #52017: Multiple intermediate pattern targets badly managed

Submitted by:  None
Submitted on:  Thu 14 Sep 2017 01:48:50 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.2.1Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 23 Sep 2017 06:20:46 PM UTC, comment #1:

Your example makefile contains:

You are assuming that %.int will always be considered intermediate. But, that's not the case.

If you run "make my.draft.res" then indeed, my.int will be considered intermediate because it needs to be created as an intermediate file between the source (my.src) and the target (my.draft.res). And, make will treat it as such.

But if you run "make my.res" then "my.int" is NOT an intermediate file; it's created as a side-effect of creating the target "my.res", not as an intermediate file (a prerequisite of "my.res"). And make doesn't treat it as such.

If you want the file to be considered intermediate always you can declare it to be such:

Paul D. Smith <psmith>
Project Administrator
Thu 14 Sep 2017 01:48:50 PM UTC, original submission:

I have a Makefile using pattern rules with multiple targets. Some of the targets are intermediate, and used on other targets.

GNU make does not identify those files are intermediate: it does not remove them after building the targets, and it rebuild everything if they are deleted.

In order to test the provided MWE, please execute:

make source

which will create the example source files.

In the provided MWE, if you execute:

make

(or make all)

this will create an intermediate file my.int. This file will not be deleted after make has finished. If you delete the file manually, next execution of:

make

will rebuild everything.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41803:  Makefile added by None (145B - application/octet-stream - MWE)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 23 Sep 2017 06:20:46 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed
    Thu 14 Sep 2017 01:48:50 PM UTCNoneAttached File-=>Added Makefile, #41803

    Back to the top


    Powered by Savane 3.1-cleanup1