[Top][All Lists]

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

Re: How to stop building when sub-make returns error

From: Paul Smith
Subject: Re: How to stop building when sub-make returns error
Date: Tue, 12 Jan 2010 12:21:08 -0500

On Tue, 2010-01-12 at 11:17 -0500, Harvey Chapman wrote:
> For more information on pipes and errors, search for "pipefail" in the
> bash man page.

> > It's not a bug. Make will react on the return status of a command. Commands
> > in Make are executed in Bash.

Just to be clear, commands in make are NOT executed by bash, exactly
(unless your makefile sets SHELL=/bin/bash of course).  They are
executed by /bin/sh.

On many GNU/Linux systems (such as Red Hat) /bin/sh is really bash.  But
on many other GNU/Linux systems (such as Ubuntu), and virtually all
non-GNU/Linux systems, /bin/sh is NOT bash, but rather some other POSIX
standard (on some systems not even POSIX!) shell.

If you care anything about portability in your makefile, please do NOT
write your recipes to rely on bash features such as pipefail.  Even if
you don't care about portability and do write your recipes to use bash
features, you need to add SHELL=/bin/bash to your makefile so everyone
will understand that you're requiring it.

reply via email to

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