When you save the project, PWB generates a makefile from the project template, files, and options you specified. This file also contains a list of instructions that are interpreted by NMAKE. In addition, PWB generates the project status file, which saves the project template, the editor state, and the build environment for the project. For more information on the project status file, see “Project Status Files”.
When you build the project, NMAKE examines the build rules in the project makefile. These are rules that specify targets (such as an object or an executable file) and the commands required to build them. For example, a rule for making a .OBJ file from a .C file can be expressed as follows:
.c.obj:
CL /c $<
To reduce the amount of time builds take, NMAKE compiles or links only the targets that are out-of-date with respect to their corresponding source file. This process is simple if there is a one-to-one correspondence between sources and targets. However, most programs use the #include directive to include definitions or other program text. The object files must be made dependent not only on the source file but also on the files that are used by the source file.
In the preceding section, you learned that you don't add include (.H) files to your project. When you save the project, PWB scans your source files looking for #include directives and builds dependencies on these files. Therefore, NMAKE recompiles a source file if you change a file that it includes.
Scanning for include files can take some time, especially when using the Windows include files. Because these system include files rarely change, you can turn on the Ignore System Include Files check box in the Edit Project dialog box. This prevents PWB from scanning these include files for dependencies.