Comments

To place a comment in a makefile, precede it with a number sign (#). NMAKE ignores all text from the number sign to the next newline character. You can use comments in the following situations:

# Comment on line by itself

OPTIONS = /MAP # Comment on macro definition line

all.exe : one.obj two.obj # Comment on dependency line

link one.obj two.obj;

# Comment in commands block

copy one.exe \release

.obj.exe: # Comment in inference rule

Command lines cannot contain comments; this is true even for a command that is specified on the same line as a dependency line or inference rule. However, a comment can appear between lines in a commands block; the # must appear at the beginning of the line.

To specify a literal #, precede it with a caret (^), as in the following:

DEF = ^#define #Macro representing a C preprocessing directive

Comments can also appear in a TOOLS.INI file. TOOLS.INI allows an additional form of comment using a semicolon (;). See “The TOOLS.INI File”.