RE: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread Cook, Malcolm
> >On Mon Feb 9 12:35:36 2015, psm...@gnu.org (Paul Smith) wrote: >> On Mon, 2015-02-09 at 16:19 +, David Aldrich wrote: >> > If I deliberately introduce a syntax error into one of my C files, >> > make calls gcc to build the file, as expected, and an error is >> > reported as text in bas

RE: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread David Aldrich
> This is bad. The simplest way to fix it is to replace the ";" with "&&", so > that > subsequent parts of the script don't run if an earlier part fails: Thanks very much for your help. That has fixed my problem. Best regards David ___ Help-make ma

Re: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread Paul Smith
On Tue, 2015-02-10 at 10:12 +, David Aldrich wrote: > define make-depend > @echo $(CXX) -c $4 $1 -o $2; \ > $(CXX) -c -MMD -MP -MF $3. $4 $1 -o $2; \ > sed 's,\($*\)\.o[ :]*,$(notdir $2) $3 : ,g' < $3. > $3; \ > rm -f $3. > endef This is exactly what I and others ha

RE: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread David Aldrich
Thanks for your replies. I haven't fixed this yet. > Why don't you provide a sample of the makefile that doesn't work? Here is the essence of my makefile (which makes a static library): # List the object files that comprise this library OBJFI

Re: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread Stephan Beal
Beware: echo $$? With 2 $, as that is a shell variable. - stephan Sent from a mobile device, possibly from bed. Please excuse brevity and typos. On Feb 10, 2015 10:57 AM, "Reinier Post" wrote: > On Mon Feb 9 12:35:36 2015, psm...@gnu.org (Paul Smith) wrote: > > On Mon, 2015-02-09 at 16:19

Re: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread Reinier Post
On Mon Feb 9 12:35:36 2015, psm...@gnu.org (Paul Smith) wrote: > On Mon, 2015-02-09 at 16:19 +, David Aldrich wrote: > > If I deliberately introduce a syntax error into one of my C files, > > make calls gcc to build the file, as expected, and an error is > > reported as text in bash. However,

Re: make is setting exit code to 0 when gcc command fails

2015-02-09 Thread Brian R Cowan
e Advisory Team (SWAT) Rational Software IBM Software Group 550 King St Littleton, MA 01460 Phone: 1.978.899.5436 Web: http://www.ibm.com/software/rational/support/ From: Paul Smith To: David Aldrich Cc: "help-make@gnu.org" Date: 02/09/2015 12:35 PM Subject: R

Re: make is setting exit code to 0 when gcc command fails

2015-02-09 Thread Paul Smith
On Mon, 2015-02-09 at 16:19 +, David Aldrich wrote: > If I deliberately introduce a syntax error into one of my C files, > make calls gcc to build the file, as expected, and an error is > reported as text in bash. However, the exit code (checked using echo > $?) returns 0. If I run the gcc co