[Top][All Lists]

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

Re: intermediate targets not working as expected

From: gmake
Subject: Re: intermediate targets not working as expected
Date: Sun, 30 Jul 2006 18:48:52 -0500 (CDT)

 g> 1. It does not remove each .exe after using it to build a .r. When a
 g> single .r has finished being built, I expect its intermediate .exe
 g> prerequisite to be removed.

That's not the way it works.  The intermediate files are all removed
only at the end of make's processing.  Make cannot know whether a given
target will need to be used more than once during a build, so it can't
delete them "as it goes".  If it did then it would have to re-build them
the next time they were needed, which is bogus.

Why can't it figure out the last dependent which uses an intermediate,
and remove the intermediate target after building the last dependent? Is
the relative order of the targets that get built fixed at the start of a
particular make invocation, or does it change dynamically? If it is
fixed, then can't you traverse the targets in the order that they will
be built, and find the last one which depends on an intermediate? You
could traverse the target graph once, marking all intermediate targets
along the way with their last usage. Then if the build is ever at a
point farther along than the last usage of an intermediate target, it
can be removed. It does not matter if targets are skipped because they
are already up to date, as long as the order stays the same.


reply via email to

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