You invoke NMAKE with the following syntax:
NMAKE [[options]] [[macros]] [[targets]]
The options field lists NMAKE options, which are described in the following section, “Command-Line Options.”
The macros field lists macro definitions, which allow you to change text in the makefile. The syntax for macros is described in “User-Defined Macros”.
The targets field lists targets to build. NMAKE builds only the targets listed on the command line. If you don't specify a target, NMAKE builds only the first target in the first dependency in the makefile. (You can use a pseudotarget to tell NMAKE to build more than one target. See “Pseudotargets”.)
NMAKE uses the following priorities to determine how to conduct the build:
1.If the /F option is used, NMAKE searches the current or specified directory for the specified makefile. NMAKE halts and displays an error message if the file does not exist.
2.If you do not use the /F option, NMAKE searches the current directory for a file named MAKEFILE.
3.If MAKEFILE does not exist, NMAKE checks the command line for target files and tries to build them using inference rules (either defined in TOOLS.INI or predefined). This feature lets you use NMAKE without a makefile as long as NMAKE has an inference rule for the target.
4.If a makefile is not used and the command line does not specify a target, NMAKE halts and displays an error message.
Example
The following command specifies an option ( /S ) and a macro definition ("program=sample") and tells NMAKE to build two targets (sort.exe and search.exe). The command does not specify a makefile, so NMAKE looks for MAKEFILE or uses inference rules.
NMAKE /S "program=sample" sort.exe search.exe