help-make
[Top][All Lists]
Advanced

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

Re: GNU Make: check if a file or directory exists


From: Paul D. Smith
Subject: Re: GNU Make: check if a file or directory exists
Date: Fri, 5 May 2006 15:39:47 -0400

%% Jim <address@hidden> writes:

  j> Is there a way I can check myself for the existence of a file or 
  j> directory in make and provide specific error message for my users?

  j> For example if the user calls:
  j>     make build_vxworks

  j> I would like a message that says:
  j>     You have not generated source code for any vxworks targets. Please 
  j> ... blah blah blah ...

There are really lots of ways to do this, depending on exactly what you
want to do... which isn't well-defined above.

But, for example:

  $(if $(wildcard $(SRCS)),,$(fatal You have not generated source code...))

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