help-make
[Top][All Lists]
Advanced

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

Continuing after errors


From: Ed Swierk
Subject: Continuing after errors
Date: Thu, 29 May 2003 16:34:54 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

My Makefile has an "all" target that runs a series of commands:

all:
        command1
        command2
        command3


I would like a make all to continue running all the commands even if an earlier command returns a nonzero code, but still have the make command itself return nonzero to indicate an error.

One way to achieve the first requirement is to prefix each command with -, so that errors are ignored:

all:
        -command1
        -command2
        -command3

However, this causes make to return 0, even when one of the commands returns nonzero. Running make --ignore-errors has the same effect.

I know it's possible to hack around this by scripting (save the return code after each command, etc.), but I thought I'd ask whether there's some simple make option that I'm overlooking.

Any tips would be appreciated.

--Ed





reply via email to

[Prev in Thread] Current Thread [Next in Thread]