NMAKE Command File

You can place a sequence of command-line arguments in a text file and pass the file's name as a command-line argument to NMAKE. NMAKE opens the command file and reads the arguments. You can use a command file to overcome the limit on the length of a command line in the operating system (128 characters in DOS).

To provide input to NMAKE with a command file, type

NMAKE @commandfile

The commandfile is the name of a text file containing the information NMAKE expects on the command line. Precede the name of the command file with an at sign (@). You can specify a path with the filename.

NMAKE treats the file as if it were a single set of arguments. It replaces each line break with a space. Macro definitions that contain spaces must be enclosed in quotation marks; see “Where to Define Macros”.

You can split input between the command line and a command file. Specify @commandfile on the command line at the place where the file's information is expected. Command-line input can precede and/or follow the command file. You can specify more than one command file.

Example 1

If a file named UPDATE contains the line

/S "program = sample" sort.exe search.exe

you can start NMAKE with the command

NMAKE @update

The effect is the same as if you entered the following command line:

NMAKE /S "program = sample" sort.exe search.exe

Example 2

The following is another version of the UPDATE file:

/S "program \

= sample" sort.exe search.exe

The backslash (\) allows the macro definition to span two lines.

Example 3

If the command file called UPDATE contains the line

/S "program = sample" sort.exe

you can start NMAKE with the command

NMAKE @update search.exe