Article View: gnu.gcc.help
Article #42224Re: Gnu Make 3.74 continues after error
From: Cy Schubert - BCSC Open Systems ...
Date: Mon, 01 Jan 1996 00:00
Date: Mon, 01 Jan 1996 00:00
54 lines
2242 bytes
2242 bytes
Steve Sullivan (sullivan@indra.com) wrote:
> Hi -
>
> I'm running gnu make 3.74 on Solaris x.86 on a pentium,
> and it continues processing the Makefile even after one the
> targets failed. It's as if I used "-k", when in fact I
> didn't. I've tried "make -S", and STILL it continues!
>
> The Makefile in question is very simple:
>
> =============== begin Makefile ====================
> DIRS = suba subb subc
>
> all:
> for ii in $(DIRS); do (cd $$ii; make all); done
> =============== end Makefile ====================
Most make programs do this. The reason for this behavior is the for
loop. When make sees the for loop it executes a shell. The shell does no
return-code checking whatsoever.
To fix the problem, try the following:
for ii in $(DIRS); do cd $$ii; if ! make all; then exit 1; fi; done
Please note that the brackets "()" will spawn another subshell.
>
> The commands I tried are:
> make
> make -S
> and both continued even after an error.
>
> When a target in a subdir fails, say suba/xxx, Make leaves the suba
> subdirectory but continues on to the next subdir.
>
> When I use Sun's make, it quits immediately upon hitting an error.
> How can I convince gnu make to likewise quit completely when it
> encounters an error?
>
> Many thanks for any suggestions -
>
> Steve Sullivan
If replying please respond to one of the addresses below.
Regards, Phone: (604)389-3827
Cy Schubert OV/VM: BCSC02(CSCHUBER)
Open Systems Support BITNET: CSCHUBER@BCSC02.BITNET
BC Systems Corp. Internet: cschuber@uumail.gov.bc.ca
cschuber@bcsc02.gov.bc.ca
"Quit spooling around, JES do it."
Technical Details
Message-ID:
<1996Jan1.101225.7371@vmsmail.gov.bc.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<DKGysu.BDL.0.net@indra.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,462c7c3a1077a015 X-Google-Attributes: gid11318c,public From: cschuber@passer.osg.gov.bc.ca (Cy Schubert - BCSC Open Systems Group) Subject: Re: Gnu Make 3.74 continues after error Date: 1996/01/01 Message-ID: <1996Jan1.101225.7371@vmsmail.gov.bc.ca> X-Deja-AN: 133616621 references: <DKGysu.BDL.0.net@indra.com> reply-to: cschuber@uumail.gov.bc.ca newsgroups: gnu.gcc.help