help-make
[Top][All Lists]
Advanced

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

Re: testing returnvalues


From: Brian Dessent
Subject: Re: testing returnvalues
Date: Mon, 22 Oct 2007 17:58:54 -0700

Brian Dessent wrote:

> Finally note that make will take the final exit code of the last command
> executed in the composite shell fragment as the status for the entire
> target rule, so make sure to propagate a success/failure to make as
> appropriate.

Here I neglected to mention that you may in fact be complicating this
way more than is necessary: the whole purpose of make is to run commands
until one returns a non-zero status at which point make halts.  So if
you just want to stop if a command returns non-zero, all you need is:

someTarget: dependencies
        myCommand --options -asdf

Or put another way, you only need to act if it's possible that a
non-zero return value for some strange reason means *success* (or if a
zero return value for some strange reason means *failure*) because
otherwise make will already do what you want and stop.

Brian




reply via email to

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