On Wed, Mar 31, 2010 at 10:27 AM, Payal
<address@hidden> wrote:
all:
cmd1 ; cmd2; cmd3
How to ignore errors from cmd2 only? Putting -cmd2 will not work here.
The return value of cmd2 WILL be ignored here. cmd2 might still generate error messages but it will not cause make to fail because make is only interested in the last return code of each shell command (in this case, that of cmd3).
That said, you can explicitly force the return code to be 0 with:
all:
cmd1 ; cmd2 || true ; cmd3
but that won't, in this case, have any effect on the make execution.
Likewise:
all:
cmd1
cmd2 || true
cmd3
would fail if either cmd1 or cmd3 failed, but will ignore a failure for cmd2.
--