previous up next print clean
Next: Clean Up: OUR LABORATORY'S REDOC RULES Previous: Build

Tube

The tube rule updates and displays the results:

tube  : ${addsuffix  .tube, ${RESULTSALL}}

%.tube: FORCE
        if   ${CANDO_GIF}    ; then	\
          ${MAKE} $*.tubegif ;		\
        elif ${CANDO_PS}     ; then	\
          ${MAKE} $*.tubeps  ;		\
        else				\
          echo "can't make $*.tubeps $*tubegif";\
        fi
RESULTSALL lists all result files and is defined as the concatenation of RESULTSNR, RESULTSCR, and RESULTSER.

At our laboratory the %.tube rule checks for the various formats of a result and chooses the first version the makefile knows how to generate. The variable CANDO contains the return value of a recursive gmake -n call. This return value indicates if that particular version of the result can be built. Having found a version that can be built, the %.tube rule invokes another rule (%.tubegif or %.tubeps) that updates and displays the result file:

%.tubegif  : ${RESDIR}/%.gif FORCE
        ${XVIEW} ${UXVIEWFLAGS} ${RESDIR}/$*.gif

%.tubeps : ${RESDIR}/%.ps FORCE
        ${GVIEW} ${UGVIEWFLAGS} ${RESDIR}/$*.ps

In the Frog example, the frog.tube rule finds a rule for computing a .gif version of frog. Consequently, it invokes the gif rule frog.tubegif. In return frog.tubegif executes xview to display the result file frog.gif. If your computer system does not support the gif viewer xview, then you will need to supplement the %.tubegif rule with your own display command. Alternatively, frog.tubeps executes ghostview to display the result file frog.ps.


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