tinderbox information.

John Dennis release-wranglers@freedesktop.org
Tue Mar 9 21:55:03 PST 2004


On Tue, 2004-03-09 at 16:03, Jim Gettys wrote:
> make -k always returns success.  So status can't be used if
> one wants to do -k builds.  So I had to change it to do -k builds.

Are you sure about this? Last week when you asked about adding -k I
wondered about make's return status and looked the documentation, I
didn't find an answer, but I assumed it would do the logical thing,
which is if any command returns non-zero the final exit status is
non-zero.

To test this I created the following Makefile:

all: one two

one:
	sh -c "exit 1"

two:
	sh -c "exit 0"


then I tried a make -k, for instance:

$ make -k; echo $?
sh -c "exit 1"
make: *** [one] Error 1
sh -c "exit 0"
make: Target `all' not remade because of errors.
2

Note, you get the non-zero exit status even if the last command
succeeded. Try various combinations of exit values for targets one and
two and you'll see it always does the right thing.

Granted, this is with GNU make, but I would expect other makes to have
the same behavior. Are you seeing something different?

John






More information about the release-wranglers mailing list