make is setting exit code to 0 when gcc command fails

2015-02-09 Thread David Aldrich
Hi I want to call make from a Python script and check make's exit code to decide whether the make succeeded. 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 (chec

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

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

2015-02-09 Thread Brian R Cowan
PMFJI, but I may have something to add here instead of spending my time lurking. I've seen cases where the recipe happens to be a shell script that includes a loop. If the loop doesn't check the return code of the steps, the build script will "successfully" complete when one of the compiles di