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.  │
└──────────────────────────────┴──────────────────────────────┘


[Back] [Next]