help-make
[Top][All Lists]
Advanced

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

Re: how to check for file existence in a makefile?


From: Paul Smith
Subject: Re: how to check for file existence in a makefile?
Date: Thu, 14 Feb 2008 08:07:41 -0500

On Thu, 2008-02-14 at 02:35 -0500, Robert P. J. Day wrote:
> what is the standard way to check for file existence in a makefile
> and bail if it doesn't exist?  personally, i use:
> 
> $(if $(wildcard <file>),,$(error "<file> is missing, bye bye."))
> 
> is there a better or more popular way?

That's the way I would do it.  Or, if you like, you could use the new
$(or ...) operator (I'm an old Lisp person :-))

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "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]