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: Paul D. Smith
Subject: Re: non-existent prerequisite w/ empty rule makes target out of date
Date: Tue, 24 Jun 2003 23:40:07 -0400

%% gk <address@hidden> writes:

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

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


Why not just:

  target: $(wildcard $(afile))
            @touch $@

?

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