help-make
[Top][All Lists]
Advanced

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

Re: how to pass the error status of a submake to a parent make


From: Philip Guenther
Subject: Re: how to pass the error status of a submake to a parent make
Date: Sat, 27 May 2006 02:42:47 -0600

On 5/27/06, Geraldin Arthy <address@hidden> wrote:
I want to know how to pass the error status of a submake to the parent make
which means even if the submake has errors the parent make should exit and
it should not build other directories.
...
So I want to know how to pass the return code of a submake to the parent
make?

By default, if any of the commands for a target fail then make will
exit with a non-zero status.  There are a few ways to tell make to
ignore the exit status of some or all commands (c.f. the GNU make info
pages, section "5.5 Errors in Commands").  Alternatively, the commands
in the makefile may have been written such that they always return
success.  For example, in this rule:

all:
       $(MAKE) -C subdir all  ||  echo "subdir failed"

the command invoked won't fail unless both the sub-make _and_ the 'echo' fail.


If the above isn't sufficient to let you see the problem in your
makefile, then you'll need to post the rule w/commands that are
involved from the makefile where the error stops propagating.


Philip Guenther




reply via email to

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