NMAKE32 provides directives that:
Each of these directives controls description file processing, rather than target processing. Read-time directives should begin with an exclamation point (!) and must start in column one. Run-time directives must be preceded by one or more spaces and must start with a percent sign (%). Spaces may exist between the conditional character and the rest of the line. For example, "! if expression" is the same as "!if expression".
The list below describes the directives:
Note: This table shows directives defined using an exclamation point.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿³Directive syntax ³Usage ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!if expression ³Processes the statements ³ ³ ³between the !if keyword and ³ ³ ³the next !else, !elif, or ³ ³ ³!endif directive if expression³ ³ ³evaluates to a non-zero value ³ ³ ³(TRUE). Otherwise, the lines ³ ³ ³are ignored. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!else ³Processes the statements ³ ³ ³between the !else and the ³ ³ ³!elif or !endif directive if ³ ³ ³the preceeding !if, !elif, ³ ³ ³!ifdef, or !ifndef expression ³ ³ ³evaluated to zero (FALSE). ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!elif expression ³Is identical to !else ³ ³ ³processing except that the ³ ³ ³lines which follow are ³ ³ ³processed only if the new ³ ³ ³expression evaluates to a ³ ³ ³non-zero value. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ !elseif expression ³Is a synonym for !elif ³ ³ ³expression. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!endif ³Marks the end of a !if, ³ ³ ³!ifdef, or !ifndef block of ³ ³ ³statements. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!foreach var [in] word_list ³Processes all statements up ³ ³ ³through the ending !endfor ³ ³ ³once for each word in ³ ³ ³word_list. During each ³ ³ ³iteration the variable var ³ ³ ³will be set to the ³ ³ ³corresponding word from the ³ ³ ³list. This macro can be ³ ³ ³referenced as any other macro ³ ³ ³would be referenced, via ³ ³ ³$(var). After all iterations ³ ³ ³are complete, the macro will ³ ³ ³retain the last value. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!endfor ³Marks the end of a !foreach ³ ³ ³block of statements. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!ifdef macro ³Is identical to !if ³ ³ ³processing, except that the ³ ³ ³statements which follow are ³ ³ ³processed only if the macro ³ ³ ³variable is currently defined.³ ³ ³Note that variables defined to³ ³ ³be the null string are still ³ ³ ³considered to be defined for ³ ³ ³!ifdef processing. For ³ ³ ³compatibility with previous ³ ³ ³versions of MAKE, the form ³ ³ ³!ifdef $(macro) is still ³ ³ ³supported. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!ifndef macro ³Is identical to !ifdef ³ ³ ³processing, except that the ³ ³ ³lines which follow are ³ ³ ³processed only if the macro ³ ³ ³variable is not currently ³ ³ ³defined. Note that variables ³ ³ ³defined to be the null string ³ ³ ³are still considered to be ³ ³ ³defined for !ifndef ³ ³ ³processing. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!undef macro ³Undefines a previously defined³ ³ ³macro. Subsequent references ³ ³ ³to $(macro) will return an ³ ³ ³empty string, and !ifdef macro³ ³ ³will evaluate to zero. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!error text ³Prints out text (macros are ³ ³ ³expanded) and then immediately³ ³ ³terminates NMAKE32 with a ³ ³ ³return code of 1. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!include [<filename>] ³Reads and evaluates the file ³ ³ ³filename before continuing ³ ³ ³with the current description ³ ³ ³file. If filename is enclosed ³ ³ ³by angle brackets (<>), ³ ³ ³NMAKE32 searches for the file ³ ³ ³in the directories specified ³ ³ ³by the INCLUDE macro; ³ ³ ³otherwise, it looks only in ³ ³ ³the directory specified. The ³ ³ ³INCLUDE macro is initially set³ ³ ³to the value of the INCLUDE ³ ³ ³environment variable. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!tryinclude [<filename>] ³Similar to !include, except if³ ³ ³the file does not exist, ³ ³ ³NMAKE32 will ignore the error ³ ³ ³and continue. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³!cmdswitches {+|-}<opt> ³Turns on or off one of four ³ ³ ³NMAKE32 options: /D, /I, /N, ³ ³ ³and /S. If no options are ³ ³ ³specified, the options are ³ ³ ³reset to the values they had ³ ³ ³when NMAKE32 was started. To ³ ³ ³turn an option on, precede it ³ ³ ³with a plus sign (+); to turn ³ ³ ³it off precede it with a minus³ ³ ³sign (-). This directive ³ ³ ³updates the MAKEFLAGS macro. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ