help-make
[Top][All Lists]
Advanced

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

Re: intermediate targets not working as expected


From: Paul D. Smith
Subject: Re: intermediate targets not working as expected
Date: Sun, 30 Jul 2006 14:48:07 -0400

%% address@hidden writes:

  g> Each .r file in RES is generated by running an .exe, which in turn is
  g> generated by compiling a .f.

  g> Everything builds and runs okay, but the .INTERMEDIATE target does not
  g> work the way I expect, in two ways:

  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.

  g> I tried a smaller, similar makefile, and it removed the .exe's after
  g> every target was built.

This shouldn't happen and I can't reproduce it in my testing.  You must
be doing something drastically different here: maybe running make
recursively instead.

  g> 2. It does not remove any .exe files if it is aborted by user interrupt
  g> (CTRL-C). All .exe files remain.

I can't reproduce this either: in my tests intermediate files are
removed at ^C.

  g> When are intermediate targets removed, if they are prerequisites to a
  g> large number of pattern targets, which in turn are prerequisites to a
  g> single target? The docs are not clear on exactly when removal occurs
  g> and whether it is delayed, and whether parallelism (-j) or recursive
  g> makes can change when an intermediate target is removed.

None of these things makes any difference.  Intermediate files are
removed after all rules are run, right before make exits.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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