10.1 Overview of NMAKE

NMAKE works by looking at the last times and dates of modification for a “target” file and its “dependents” and then comparing them. A target is usually a file you want to create, such as an executable file. A dependent is usually a file from which a target is created, such as a source file. A target is “out-of-date” if any of its dependents has changed more recently than the target.

WARNING :

For NMAKE to work properly, the date and time setting on your system must be consistent relative to previous settings. If you set the date and time each time you start the system, be careful to set it accurately. If your system stores a setting, be certain that the battery is working.

When you run NMAKE, it reads a “description file” that you supply. The description file consists of one or more description blocks. Each description block typically lists a target, the target's dependents, and the commands that build the target. NMAKE compares the last time the targets changed to the last time the dependents changed. If the modification time of any dependents is the same or later than the time of the target, NMAKE updates the target by executing the command or commands listed in the description block.

NMAKE's main purpose is to help you update applications quickly and simply. However, it can execute any DOS or OS/2 command, so it is not limited to compiling and linking. NMAKE can also make backups, move files, and perform other project-management tasks that you ordinarily do at the operating-system prompt.