Error checking behavior of makefile
makefile, return-value
Solution
mycommand; test $? -gt 3
Change the test as appropriate. I don't think using `-` or `-k` is a good idea, as it will stop `make` from detecting errors.
Note the 2 commands MUST be on the same line, when in a makefile.
Added after comment feedback: You can also do the following, to allow you to unconditionally run follow-on commands before reacting to an error:
mycommand; status=$PIPESTATUS; follow-on-command && test $status -gt 3
Problem
If my program has to return different values (e.g. 0, 1, 2, 3, etc) for different outcomes (mostly errors), the makefile that calls this program would have to stop executing the rest of the makefile commands. Is there a way to continue executing the makefile even if that command produced an error (return a non-zero value)? Thank you all.