Exit Codes from Commands

NMAKE stops execution if a command or program executed in the makefile encounters an error and returns a nonzero exit code. The exit code is displayed in an NMAKE error message.

You can control how NMAKE behaves when a nonzero exit code occurs by using the /I or /K option, the .IGNORE directive, the !CMDSWITCHES directive, or the dash () command modifier.

Another way to use exit codes is during preprocessing. You can run a command or program and test its exit code using the !IF preprocessing directive. For more information, see “Executing a Program in Preprocessing”.