help-make
[Top][All Lists]
Advanced

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

Re: Testing rule success


From: Paul Smith
Subject: Re: Testing rule success
Date: Mon, 30 Jul 2007 18:39:20 -0400

On Mon, 2007-07-30 at 01:00 -0500, David A. Greene wrote:

> Is there a way to test for existence of some_file from another rule?
> 
> For example:
> 
> some_rule : some_file
>       $(if $(DO_EXISTENCE_TEST_HERE),$(DO_GOODSTUFF),$(DO_BADSTUFF))
> 
> $(wildcard some_file) doesn't always seem to be reliable.

There is no other way to do it than wildcard.  As long as you're testing
for the existence of a TARGET file (that is declared a target in the
makefile and only updated through the auspices of a make rule with that
file as a target) then wildcard should always be accurate.  If it's not,
that's a bug.

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