Return Codes Generated by NMAKE

ID Number: Q72695

1.00 1.01 1.10 1.11 1.12 1.13 | 1.01 1.10 1.11 1.12 1.13

MS-DOS | OS/2

Summary:

According to the documentation, the NMAKE utility will return 0 (zero)

for success and nonzero for failure if it cannot build the project.

This return value can be tested with the IF ERRORLEVEL command in a

batch file, or with NMAKE itself, if it is calling itself recursively.

There are actually several distinct return values that you can test in

your build process and these are given in the following table:

Return Value Meaning

------------ -------

0 No Error

2 Error (except when out of memory)

4 Out of memory

255 Target is not up to date

Special Notes:

1. NMAKE returns 2 for syntax errors, errors in executing a command,

errors on user interrupt, or when a command exits with an error

code.

2. NMAKE never returns the error code returned by an executing

command.

3. When invoking NMAKE and specifying the /I option to ignore return

codes, NMAKE always returns 0 (zero).

4. When the /Q option is specified, NMAKE returns either 0 when the

target is up-to-date or 255 when the target is not up-to-date.

5. New return values may be added in the future as needs warrant.