[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Presence-only dependencies?
From: |
Matthew Sanderson |
Subject: |
Re: Presence-only dependencies? |
Date: |
Mon, 24 Oct 2005 09:59:06 +1000 (EST) |
<slaps forehead> D'oh! I remember that feature now, but it didn't occur to
me to use it like that. Thanks, Paul.
--matthew
Matthew Sanderson
Senior Programmer (UNIX)
TCG Information Systems Pty Ltd
Sydney, Australia
address@hidden
http://www.formtrap.com/
+61 (02) 8303 2407
On Fri, 21 Oct 2005, Paul D. Smith wrote:
> %% 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
>