Subject: Re: make question
To: None <netbsd-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2007.salmi.ch>
List: netbsd-users
Date: 05/13/2007 22:20:37
Hi,

Jan Danielsson --> netbsd-users (2007-05-13 19:28:51 +0200):
> Hello,
> 
>    When I create a target called "cleanall", and it fails to do
> something, it doesn't complain. For instance:
> 
> --------------------
> cleanall:
> 	rm *.o foobar
> --------------------
> 
>    If *.o or foobar don't exist, it doesn't complain, which is good.

Only if this `or' is an exclusive or. If both *.o and foobar don't
exist, then make should complain because rm(1) returns a non-zero exit
status.


>    However, if I create a "clean" target, it does complain when it tries
> to remove files which don't exist.
> 
>    Is there any way to make targets shut up if the commands fail?

Prepend a `-' to the command in your makefile. See `SHELL COMMANDS'
in make(1)s manpage.


HTH, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~