previous up next print clean
Next: ACKNOWLEDGMENTS Up: OUR LABORATORY'S REDOC RULES Previous: Tube

Clean

A community's cleaning rule is designed to remove the intermediate files and thereby to isolate the source and result files. A universal cleaning rule attempts to recognize the intermediate files according to the community's naming conventions. Unfortunately, such a rule cannot possibly anticipate all names the author may choose for his intermediate files. Consequently, our laboratory does not supply a fixed, universal clean rule, but a jclean (Jon's clean) rule. jclean removes the files that adhere to our laboratory's naming convention for intermediate files. Every author is responsible to implement his own clean rule. Most authors at our laboratory accept the default cleaning rule by defining clean as:

clean: jclean

Some authors at our laboratory append the default jclean with a command to remove some additional files that do not adhere to the standard naming conventions. Only very few authors ignore the jclean target (and its communal wisdom) and design their own rule.

Since the author of the Frog example adheres strictly to the ReDoc naming conventions for files, the default jclean mechanism suffices to remove the intermediate files:

jclean : klean.usual klean.fort ;

KLEANUSUAL := core a.out paper.log *.o *.x *.H *.ps *.gif 
klean.usual :
        @-${TOUCH} ${KLEANUSUAL} junk.quiet
        @-${RM}    ${KLEANUSUAL} junk.*

FORT_FILES = $(patsubst %.f,%,$(wildcard *.f)) junk.quiet
klean.fort:
        @\
        for name in ${FORT_FILES} ; do				\
          if  ${EXIST} $${name}.r ; then 			\
              ${TOUCH} $${name}.f ;				\
              ${RM}    $${name}.f ;				\
          fi ;							\
        done

The jclean target uses two methods to identify intermediate files. The first method, klean.usual, simply removes files whose names fit one of the rule's name patterns: e.g. the executable frog.x, or the intermediate bitmap files junk.pgm and junk.ppm. The second method, klean.fort, removes FORTRAN files, such as frog.f, if RATFOR versions of the program, such as frog.r, exist.

 
xtpanel
xtpanel
Figure 3
The reader interface for reproducible research is only one component of SEP's current computational research environment: A research document at SEP is written in LATEX(visible in the background to the left). Using SEP's own LATEX macros, a push-button in each figure caption invokes a graphic user interface (written in a script language called xtpanel). The graphic user interface enables a reader to interactively execute the burn, build, clean, and tube commands for each individual figure. (The panel is shown in the foreground. The result of make tube is shown towards the right.) SEP's GNU make rules allow an author to easily extend the interactivity of a result figure to additional, application-specific actions. Unfortunately these features are beyond the scope of this article. However, we distribute our collection of software and the theses of our research group on CD-ROMs.


view

We are currently collaborating with Richard Stallman of the Free Software Foundation to develop an alternative, more reliable cleaning mechanism. This alternative mechanism would free the author from naming the intermediate files according to the community's naming conventions. The anticipated cleaning mechanism analyses the makefile's rules and dependencies to identify the intermediate files. Fastidious authors would have the option of automatically removing all files that are neither source files nor result files.


previous up next print clean
Next: ACKNOWLEDGMENTS Up: OUR LABORATORY'S REDOC RULES Previous: Tube
Stanford Exploration Project
11/12/1997