next up previous print clean
Next: Build Up: Our laboratory's Redoc rules Previous: Our laboratory's Redoc rules

Burn

The burn rule invokes a chain of rules, which ultimately finds all easily reproducible result files and removes them. The burn target is included in every application makefile as part of the ReDoc rules.

burn: burnER

burnER: ${addsuffix .burn, ${RESULTSER}}
burnCR: ${addsuffix .burn, ${RESULTSCR}}

%.burn: 
        ${foreach sfx, ${RES_SUFFIXES} ,	\
          if ${EXIST} ${RESDIR}/$*${sfx} ; then	\
             ${RM}    ${RESDIR}/$*${sfx} ;  fi;	\
          }

The burn target invokes its dependency burnER. The burnER rule selects the easily reproducible result files for removal. The burnER rule uses GNU make's built-in function addsuffix to generate its dependency list. Each entry of burnER's dependency list is a concatenation of the name of an easily reproducible file and the suffix .burn. In the Frog example, burnER depends on frog.burn and dot.burn. The dependency frog.burn invokes the pattern rule %.burn, which removes the result files corresponding to the result frog. At our laboratory a single result name such as frog usually denotes several result files of identical contents but differing format, e.g. postscript or gif. The %.burn rule scans a list of possible suffixes (RES_SUFFIXES = .ps .gif) and removes all related result files: frog.ps and frog.gif.

Since text result files, such as dot.txt, are rare at our laboratory, the ReDoc rules do not contain laboratory-wide rules for handling them. Consequently the author of the Frog document supplies an explicit dot.burn rule in the makefile. This explicit dot.burn rule overrides the default %.burn pattern rule, which generates postscript result files.

The standard burn rule exclusively removes the easily reproducible result files. A reader can remove any existing, conditionally reproducible result files by invoking make burnCR. A reader can exclusively remove the result files related to the frog result by invoking make frog.burn.


next up previous print clean
Next: Build Up: Our laboratory's Redoc rules Previous: Our laboratory's Redoc rules
Stanford Exploration Project
3/8/1999