help-make
[Top][All Lists]
Advanced

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

Re: Presence-only dependencies?


From: Paul D. Smith
Subject: Re: Presence-only dependencies?
Date: Fri, 21 Oct 2005 17:00:48 -0400

%% Matthew Sanderson <address@hidden> writes:

  ms> To be precise: I am defining a presence-only dependency of A on B
  ms> to mean that A depends only on the presence of a file named B; B's
  ms> last-mod-time is not taken into account. A will not be
  ms> re-generated if B is newer; but if B is missing, a seperate
  ms> (normal) rule may re-generate it, and if so, then afterwards the
  ms> presence-only dependency rule will cause A to also be re-generated
  ms> from the just-created B.

I think you can do this with current capabilities, like this:

    A: $(if $(wildcard B),,B)

which will result in "A: B" if B does _NOT_ exist, or just "A:" (with no
prerequisite) if B _DOES_ exist.

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