bug-make
[Top][All Lists]
Advanced

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

RE: Reg Make build on LINUX


From: Paul Smith
Subject: RE: Reg Make build on LINUX
Date: Fri, 23 May 2008 14:21:42 -0400

On Fri, 2008-05-23 at 19:14 +0100, Dave Korn wrote:
> A, Sravanthi wrote on 23 May 2008 12:14:
> 
> > Hi team,
> > 
> > Iam trying to build my application using make on Linux server. But my
> > build doesn't stop after first error. I tried -S options  but doesn't
> > seems to help.
> 
>   The top-level makefile might be invoking the sub-makes using "-" at the
> start of the commandline to suppress errors?  See the "Errors in Commands"
> section of the man/info page.

It's almost certainly the classic case of using a for-loop to do
recursion, like this:

        all:
                for dir in $(SUBDIRS); do cd $$dir && $(MAKE) all; done

or similar.  If one of the sub-makes other than the last one fails, the
loop doesn't fail it just keeps going.

Solaris make invokes all shells with the "-e" flag, which causes the
command to exit immediately on any error, so the above "works".
However, it is not conformant to the POSIX spec for make, and GNU make
has never worked like that.

You should rewrite your recursion as discussed in the GNU make manual,
with a separate rule for each subdirectory.  That way when one fails,
the make will fail (and flags like -k and -j will work properly as
well).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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