Commands in a .mak File

Windows CE .NET

A description block or inference rule specifies a block of commands to run if the dependency is out-of-date. Nmake.exe displays each command before running it, unless /S, .SILENT, !CMDSWITCHES, or @ is used. Nmake.exe looks for a matching inference rule if a description block is not followed by a commands block.

A commands block contains one or more commands, each on its own line. No blank line can appear between the dependency or rule and the commands block. However, a line containing only spaces or tabs can appear; this line is interpreted as a null command, and no error occurs. Blank lines are permitted between command lines.

A command line begins with one or more spaces or tabs. A backslash ( \ ) followed by a newline character is interpreted as a space in the command; use a backslash at the end of a line to continue a command onto the next line. Nmake.exe interprets the backslash literally if any other character, including a space or tab, follows the backslash.

The following code example shows that a command that is preceded by a semicolon (;) can appear on a dependency line or inference rule, regardless of whether a commands block follows.

Project.obj : project.c project.h ; cl /c project.c

See Also

Description Blocks | Dependents

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.