previous up next print clean
Next: CONCLUSION Up: IMPLEMENTATION Previous: Document levels

Secondary targets

The reproducibility of an electronic documents requires the source files. The representation of a document is composed of the result files. The secondary files are used only in the process of generating the result files from the source files.

Secondary files can be prohibitively large, and they generally clutter the system. For these reasons, they are typically removed soon after they perform their function of helping to create result files. If a result file were considered out-of-date when one of its secondary files was missing, we would need to retain the secondary files to avoid redundant recomputation of the result files. Therefore, we wanted GNU make to consider result files with missing secondary files to be up-to-date. This would make it possible to freely remove secondary files.

Standard GNU make distinguishes between secondary files associated with pattern rules (intermediate targets) and secondary files associated with non-pattern rules (i.e., rules that do not involve pattern matching). In the case of a missing secondary which is the target of a pattern rule, GNU make considers an associated result file to be up-to-date. On the other hand, for a missing non-pattern secondary target, such a result file is out-of-date.

At our request, Richard Stallman added a special built-in target to GNU make, .SECONDARY, which allows the author to choose the aforementioned behavior of GNU make with respect to its missing secondary targets. Any target listed as a dependency of .SECONDARY is assumed up-to-date when missing. Listing .SECONDARY without any dependency ensures that every missing secondary file is presumed up-to-date. At SEP, the special built-in target .SECONDARY is included with the SEP.defs.top file, causing GNU make to assume a target with any missing secondary files is up-to-date. In short, .SECONDARY makes the behavior of pattern and non-pattern rules the same with respect to secondary files.


previous up next print clean
Next: CONCLUSION Up: IMPLEMENTATION Previous: Document levels
Stanford Exploration Project
11/12/1997