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.
Change the test as appropriate. I don’t think using
-or-kis a good idea, as it will stopmakefrom 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: