I have a python makefile. I can run its commands from my bash script as below
local make_lint_output=\"\" make_lint_output=\"$( make test-unit 2>&1 )\" e
echo is succeeding, and thus returning 0. You have to capture the return code before running another command that may clobber $? (before the echo).
echo
$?