bugmake - Bugs: bug #127, Intermediate file deletion using...

 
 

bug #127: Intermediate file deletion using pattern rules with multiple targets not correct

Submitter:  Johan Bezem <jbezem>
Submitted:  Thu 25 Apr 2002 09:52:35 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.79.1 Operating System:  Any
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 29 Nov 2004 05:55:05 AM UTC, comment #1: 

This bug has been fixed in CVS and the fix will be included in the next release of GNU make.

Paul D. Smith <psmith>
Group administrator
Thu 25 Apr 2002 09:52:35 AM UTC, original submission:  

When intermediates are created using a pattern rule with multiple targets, only the first (intermediate) target to be created is deleted after the processing has ended.
As an example, I have a 'file.input' with arbitrary contents, and I'm using the attached makefile.

Since 'file.out' is the first prerequisite of target 'all', the intermediate 'file.int' is created first, but the commands for it also create 'file-nodelete.int' in the process. The commands are - correctly - executed only
once.
Now, if 'file-nodelete.out' would not be a prerequisite of 'all', 'file-nodelete.int' would arguably not be deleted afterwards, possibly since make doesn't retain any knowledge about files it doesn't need.
However, since 'file-nodelete.int' is a required intermediate file, I would expect it to be deleted after the process, just like 'file.int' is. The output of running
make, however, reads like this:

[jbezem] darkstar:TmpTest/$ make -f Makefile-indirect
echo "intfile, target file.int" > file.int
echo "intfile nodelete, target file-nodelete.int" > file-nodelete.int
cat file.int > file.out
rm file.int

I've tested this both on Windows NT4, using CygWin 1.3.10, make 3.79.1-5, and on Solaris 2.7, make 3.79.1.
The inclusion of the special target name '.INTERMEDIATE' for all *.int files induces make to delete both files, however, wildcards are not supported... I couldn't find anything in the archives or the manual, either.

Johan Bezem <jbezem>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #3:  Makefile-indirect added by jbezem (453B - text/plain - Makfile to reproduce observed behavior.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2004-11-29 psmith StatusNone Fixed
    Assigned toNone psmith
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code