[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Brian Dessent
Subject: Re: Help on .INTERMEDIATE
Date: Fri, 01 Feb 2008 12:39:49 -0800

Hoolam Woon wrote:

> Where did I go wrong? Did I misunderstood .INTERMEDIATE?
> Thanks in advance.

I think so.  I don't think .INTERMEDIATE is a blunt hammer that says
"delete these things at the end."  In the manual it says that if make
creates an intermediate target as part of the dependency chain in order
to update some other target, then it will delete the intermediate

So there are several things here: first, tempFile and tempDir aren't
actually used anywhere in your example as targets -- make simply sees
the 'all' target with no prerequisites and makes that, and exits.

Second, they aren't part of any chain so they would never be used in the
situation the manual describes.

Third, the tempFile is created by the $(shell mktemp) line, not by a
tempFile target rule.  It will already exist when make starts evaluating
what targets need to be remade, and therefore make would not run any
tempFile rule even if one existed, and thus it will probably not think
that it must be deleted either since make didn't run a rule to produce

And fourth, the manual seems to imply that they are deleted by invoking
"rm -f", which means that make would not be able to remove a directory.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]