[Top][All Lists]

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

Re: non-recursive build question

From: Paul D. Smith
Subject: Re: non-recursive build question
Date: Wed, 28 Apr 2004 00:35:47 -0400

%% Sandy Currier <address@hidden> writes:

  sc> Actually, though the primary point is to not have targets that
  sc> depend on foo.exp rebuild when it is not physically changed, the
  sc> secondary point IS to touch the foo.exp target.  By touching it
  sc> when it is rebuilt, then the next time that make is run, if none
  sc> of the $(ALL_FOO_OFILES) have changed, then the neither foo.exp or
  sc> is rebuilt.

Well, you can't have it both ways: either the target is updated, in
which case things that depend on the target are updated, or it's not
updated, in which case it will be re-assessed in relation to its
prerequisites the next time make is run.

Well, you could actually get both but you need an extra file; you can
use this "sentinel" file to manage controlling the expensive part and
then the only part that is run multiple times is the cheap part of
comparing the results.

For example: $(ALL_FOO_OFILES) foo.exp

            if [ "x` address@hidden" != "x` $<`" ]; then \
              cp $< $@; \
            fi $(ALL_FOO_OFILES)
   $@ $^

Now will only be invoked when some OFILE actually
changes, and foo.exp will only be updated when the export list has
changed, but you don't pay the cost of updating the export list every
time you only pay the cost of the comparison.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]