List Info

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




how to check for file existence in a makefile?
user name
2008-02-14 01:35:00
  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?

rday
--

============================================================
============
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca   
                      Waterloo, Ontario, CANADA
============================================================
============


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: how to check for file existence in a makefile?
user name
2008-02-14 07:07:41
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 <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.mad-scientis
t.us
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )