During an Xcode build, I run a custom script calling "make". In order to parse the error messages to obey Xcode error formatting, I use:
make 2>&1
Then reformat every line using sed.
The problem is, this causes any make error exit codes to disappear, and Xcode reports:
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
or even a "build succeeded" with link errors.
How can I get back the error exit codes?