help-make
[Top][All Lists]
Advanced

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

Re: non-existent prerequisite w/ empty rule makes target out of date


From: gk
Subject: Re: non-existent prerequisite w/ empty rule makes target out of date
Date: Tue, 24 Jun 2003 17:45:27 -0700

At 08:02 PM 6/24/2003 -0400, Paul D. Smith wrote:
  g> I want the prerequisite file to affect building target, only if it
  g> exists; otherwise target should be considered up to date.
  g> How best to achieve this?

You can't.

See Bug (enhancement request) #109 at the GNU make project page on
Savannah.

I am using the following ifneq, which seems good enough for my purposes.
$(afile) is a file that may or may not exist.
Thanks for the insights.

ifneq (,$(wildcard $(afile)))
target: $(afile)
        @touch $@
else
target:
        @touch $@
endif

- Greg Keraunen
http://www.xmake.org





reply via email to

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