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.
|