home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / cake / part06 / Lib / Text < prev    next >
Encoding:
Text File  |  1987-10-15  |  7.0 KB  |  287 lines

  1. $    Obsolete cakefile for text processing.
  2.  
  3. $    Use Newtext instead.
  4.  
  5. #ifndef    NOSPACE
  6. #define    SPACE
  7. #endif
  8.  
  9. #ifndef    MPAC
  10. #define    MPAC    -me
  11. #endif
  12. #ifndef    LBLOPTS
  13. #define    LBLOPTS
  14. #endif
  15. #ifndef    ROFFOPTS
  16. #define    ROFFOPTS
  17. #endif
  18. #ifndef    BIBPROG
  19. #define    BIBPROG    bib
  20. #endif
  21. #ifndef    LASDEV
  22. #define    LASDEV    -Pip
  23. #endif
  24. #ifndef    PAGER
  25. #define    PAGER    more
  26. #endif
  27. #ifndef    PRINT
  28. #define    PRINT    lpr
  29. #endif
  30. #ifndef    PNDK
  31. #define    PNDK    -Pcl
  32. #endif
  33. #ifndef    PLASER
  34. #define    PLASER    LASDEV -n
  35. #endif
  36. #ifndef    PGEN
  37. #define    PGEN    -Pbds
  38. #endif
  39.  
  40. #define    need(prog)    prog in [[needed %.orig]]
  41.  
  42. #ifdef    SPACE
  43. #ifndef    IDIR
  44. #define    IDIR    /tmp/
  45. #endif
  46. #ifndef    FDIR
  47. #define    FDIR    /tmp/
  48. #endif
  49. #ifndef    ADIR
  50. #define    ADIR
  51. #endif
  52. #define    ISUFF    lbl bib dte de d ne n base
  53. #define    FSUFF    laser more nice fine
  54. #define    ASUFF    refs cit chnr cheq ol spell double dict style astyle exp hard mod long pass count Count
  55. #define    NOSUFF    frame orig all fix clean vclean
  56. #else
  57. #define    IDIR
  58. #define    FDIR
  59. #define    ADIR
  60. #endif
  61.  
  62. /* general services */
  63. #ifndef    SPACE
  64. %1.%2.m&:    %1.%2
  65.         PAGER %1.%2
  66.  
  67. #ifdef    CHUNK
  68. %1.%2.p&:    %1.%2                if %2 in laser
  69.         -@/bin/rm chunk*
  70.         troffchunk -n 6 %1.%2
  71.         PRINT PLASER chunk*
  72. #else
  73. %1.%2.p&:    %1.%2                if %2 in laser
  74.         PRINT PLASER %1.%2
  75. #endif
  76.  
  77. %1.%2.p&:    %1.%2                if %2 in fine nice
  78.         PRINT PNDK %1.%2
  79.  
  80. %1.%2.p&:    %1.%2                if not %2 in laser fine nice
  81.         PRINT PGEN %1.%2
  82.  
  83. #else
  84. %1.%2.m&:    %1.%2                if %2 in NOSUFF
  85.         PAGER %1.%2
  86.  
  87. %1.%2.m&:    IDIR/**/%1.%2            if %2 in ISUFF
  88.         PAGER IDIR/**/%1.%2
  89.  
  90. %1.%2.m&:    FDIR/**/%1.%2            if %2 in FSUFF
  91.         PAGER FDIR/**/%1.%2
  92.  
  93. %1.%2.m&:    ADIR/**/%1.%2            if %2 in ASUFF
  94.         PAGER ADIR/**/%1.%2
  95.  
  96. %1.%2.p&:    %1.%2                if %2 in NOSUFF
  97.         PRINT PGEN %1.%2
  98.  
  99. %1.%2.p&:    IDIR/**/%1.%2            if %2 in ISUFF
  100.         PRINT PGEN IDIR/**/%1.%2
  101.  
  102. #ifdef    CHUNK
  103. %1.%2.p&:    FDIR/**/%1.%2            if %2 in laser
  104.         -@/bin/rm -f chunk*
  105.         troffchunk -n 6 FDIR/**/%1.%2
  106.         PRINT PLASER chunk*
  107. #else
  108. %1.%2.p&:    FDIR/**/%1.%2            if %2 in laser
  109.         PRINT PLASER FDIR/**/%1.%2
  110. #endif
  111.  
  112. %1.%2.p&:    FDIR/**/%1.%2            if %2 in more
  113.         PRINT PGEN FDIR/**/%1.%2
  114.  
  115. %1.%2.p&:    FDIR/**/%1.%2            if %2 in fine nice
  116.         PRINT PNDK FDIR/**/%1.%2
  117.  
  118. %1.%2.p&:    ADIR/**/%1.%2            if %2 in ASUFF
  119.         PRINT PGEN ADIR/**/%1.%2
  120. #endif
  121.  
  122. #ifdef    SPACE
  123. %1.%2&:        IDIR/**/%1.%2            if %2 in ISUFF and {{nonnull IDIR}} and not {{sub X1/X2 NULL %1 >& /dev/null}}
  124. %1.%2&:        FDIR/**/%1.%2            if %2 in FSUFF and {{nonnull FDIR}} and not {{sub X1/X2 NULL %1 >& /dev/null}}
  125. %1.%2&:        ADIR/**/%1.%2            if %2 in ASUFF and {{nonnull ADIR}} and not {{sub X1/X2 NULL %1 >& /dev/null}}
  126. #endif
  127.  
  128. /* soelim */
  129. %.orig:        %.frame [[soincl %.frame]]    if exist %.frame
  130.         soelim %.frame > %.orig
  131.  
  132. /* lbl */
  133. IDIR/**/%.lbl^:    %.orig*                if need(lbl)
  134.         lbl LBLOPTS %.orig > IDIR/**/%.lbl
  135.  
  136. IDIR/**/%.lbl^:    %.orig*                if not need(lbl)
  137.         @/bin/rm -f IDIR/**/%.lbl
  138.         ln -s [[/bin/pwd]]/%.orig IDIR/**/%.lbl
  139.  
  140. /* bib */
  141. IDIR/**/%.bib^:    IDIR/**/%.lbl %.orig* BIB    if need(bib)
  142.         BIBPROG -p/**/BIBS -t/**/STYLE IDIR/**/%.lbl > IDIR/**/%.bib
  143.  
  144. IDIR/**/%.bib^:    IDIR/**/%.lbl %.orig*        if need(listrefs)
  145.         listrefs -t/**/STYLE IDIR/**/%.lbl > IDIR/**/%.bib
  146.  
  147. IDIR/**/%.bib^:    IDIR/**/%.lbl %.orig*        if not need(bib) and not need(listrefs)
  148.         @/bin/rm -f IDIR/**/%.bib
  149.         ln -s IDIR/**/%.lbl IDIR/**/%.bib
  150.  
  151. /* laser pic */
  152. IDIR/**/%.dte^:    IDIR/**/%.bib %.orig*        if need(pic)
  153.         pic LASDEV PMAC IDIR/**/%.bib > IDIR/**/%.dte
  154.  
  155. IDIR/**/%.dte^:    IDIR/**/%.bib %.orig*        if not need(pic)
  156.         @/bin/rm -f IDIR/**/%.dte
  157.         ln -s IDIR/**/%.bib IDIR/**/%.dte
  158.     
  159. /* laser tbl */
  160. IDIR/**/%.de^:    IDIR/**/%.dte %.orig*        if need(tbl)
  161.         dtbl LASDEV IDIR/**/%.dte > IDIR/**/%.de
  162.  
  163. IDIR/**/%.de^:    IDIR/**/%.dte %.orig*        if not need(tbl)
  164.         @/bin/rm -f IDIR/**/%.de
  165.         ln -s IDIR/**/%.dte IDIR/**/%.de
  166.     
  167. /* laser eqn */
  168. IDIR/**/%.d^:    IDIR/**/%.de %.orig*        if need(eqn)
  169.         deqn LASDEV EMAC IDIR/**/%.de > IDIR/**/%.d
  170.  
  171. IDIR/**/%.d^:    IDIR/**/%.de %.orig*        if not need(eqn)
  172.         @/bin/rm -f IDIR/**/%.d
  173.         ln -s IDIR/**/%.de IDIR/**/%.d
  174.     
  175. /* laser troff */
  176. FDIR/**/%.laser:IDIR/**/%.d
  177.         ditroff -t LASDEV ROFFOPTS MPAC IMAGEN SIMLAS TMAC IDIR/**/%.d > FDIR/**/%.laser
  178.  
  179. /* ndk tbl */
  180. IDIR/**/%.ne^:    IDIR/**/%.bib %.orig*        if need(tbl)
  181.         tbl IDIR/**/%.bib > IDIR/**/%.ne
  182.  
  183. IDIR/**/%.ne^:    IDIR/**/%.bib %.orig*        if not need(tbl)
  184.         @/bin/rm -f IDIR/**/%.ne
  185.         ln -s IDIR/**/%.bib IDIR/**/%.ne
  186.     
  187. /* ndk eqn */
  188. IDIR/**/%.n^:    IDIR/**/%.ne %.orig*        if need(eqn)
  189.         neqn EMAC IDIR/**/%.ne > IDIR/**/%.n
  190.  
  191. IDIR/**/%.n^:    IDIR/**/%.ne %.orig*        if not need(eqn)
  192.         @/bin/rm -f IDIR/**/%.n
  193.         ln -s IDIR/**/%.ne IDIR/**/%.n
  194.     
  195. /* ndk nroff */
  196. FDIR/**/%.more:    IDIR/**/%.n
  197.         nroff ROFFOPTS MPAC SIMNDK TMAC IDIR/**/%.n > FDIR/**/%.more
  198.  
  199. FDIR/**/%.nice:    IDIR/**/%.n
  200.         nroff -F -e -TNDK12 ROFFOPTS MPAC SIMNDK TMAC IDIR/**/%.n > IDIR/**/%.tmp
  201.         @ndk -igrs IDIR/**/%.tmp | expand > FDIR/**/%.nice
  202.         @/bin/rm -f IDIR/**/%.tmp
  203.  
  204. FDIR/**/%.fine:    IDIR/**/%.n
  205.         nroff -F -e -TNDK10 ROFFOPTS MPAC SIMNDK TMAC IDIR/**/%.n > IDIR/**/%.tmp
  206.         @ndk -irs IDIR/**/%.tmp | expand > FDIR/**/%.fine
  207.         @/bin/rm -f IDIR/**/%.tmp
  208.  
  209. /* analysis services */
  210. %.all&:        %.spell %.double %.style %.exp %.mod %.long %.pass %.dict %.chnr
  211.  
  212. IDIR/**/%.base^:%.orig*
  213.         base < %.orig | sed -e 's/XXX//g' > IDIR/**/%.base
  214.  
  215. ADIR/**/%.refs:    %.orig*
  216.         refs < %.orig | tr ',' '\\\\012' | sed -e 's/^ *//' | sort -u > ADIR/**/%.refs
  217.  
  218. ADIR/**/%.cit:    %.refs
  219.         lookup -p/**/BIBS < %.refs > ADIR/**/%.icit
  220.         @gred "No references found." ADIR/**/%.icit
  221.         sortbib ADIR/**/%.icit > ADIR/**/%.cit
  222.         @/bin/rm ADIR/**/%.icit
  223.  
  224. ADIR/**/%.chnr:    %.orig*
  225.         checknr CHNROPTS TMAC %.orig > ADIR/**/%.chnr
  226.  
  227. ADIR/**/%.cheq:    %.orig*
  228.         -checkeq CHEQOPTS EMAC %.orig > ADIR/**/%.cheq
  229.  
  230. ADIR/**/%.ol:    %.orig*
  231.         ol %.orig > ADIR/**/%.ol
  232.  
  233. %.fix&:        %.orig*
  234.         fix -d DICT %.orig
  235.  
  236. ADIR/**/%.double:%.orig*
  237.         double %.orig > ADIR/**/%.double
  238.  
  239. ADIR/**/%.spell:IDIR/**/%.base
  240.         spell SPELLOPTS IDIR/**/%.base | tr A-Z a-z | comm -23 - DICT > ADIR/**/%.spell
  241.  
  242. ADIR/**/%.dict:    IDIR/**/%.base
  243.         diction IDIR/**/%.base > ADIR/**/%.dict
  244.  
  245. ADIR/**/%.style:IDIR/**/%.base
  246.         style MPAC STYLEOPTS IDIR/**/%.base > ADIR/**/%.style
  247.  
  248. ADIR/**/%.astyle:IDIR/**/%.base
  249.         style MPAC STYLEOPTS -a IDIR/**/%.base > ADIR/**/%.astyle
  250.  
  251. ADIR/**/%.exp:    IDIR/**/%.base
  252.         style MPAC STYLEOPTS -e IDIR/**/%.base > ADIR/**/%.exp
  253.  
  254. ADIR/**/%.hard:    IDIR/**/%.base
  255.         style MPAC STYLEOPTS -r HARD IDIR/**/%.base > ADIR/**/%.hard
  256.  
  257. ADIR/**/%.mod:    IDIR/**/%.base
  258.         style MPAC STYLEOPTS -r MOD IDIR/**/%.base > ADIR/**/%.mod
  259.  
  260. ADIR/**/%.long:    IDIR/**/%.base
  261.         style MPAC STYLEOPTS -l LONG IDIR/**/%.base > ADIR/**/%.long
  262.  
  263. ADIR/**/%.pass:    IDIR/**/%.base
  264.         style MPAC STYLEOPTS -p IDIR/**/%.base > ADIR/**/%.pass
  265.  
  266. ADIR/**/%.count:IDIR/**/%.base
  267.         deroff IDIR/**/%.base | wc > ADIR/**/%.count
  268.  
  269. ADIR/**/%.ocount:%.orig*
  270.         wc %.orig > ADIR/**/%.ocount
  271.  
  272. %.clean&:
  273.         @echo cleaning up %
  274.         -@/bin/rm %.spell %.style %.astyle >& /dev/null
  275.         -@/bin/rm %.exp %.hard %.mod %.long %.pass >& /dev/null
  276.         -@/bin/rm %.dict %.count %.ocount %.base >& /dev/null
  277.         -@/bin/rm %.refs %.double %.ol %.chnr %.cheq >& /dev/null
  278.         -@/bin/rm %.dte %.de %.d %.ne %.n >& /dev/null
  279.         -@/bin/rm %.laser %.nice %.fine %.more >& /dev/null
  280.  
  281. %.vclean&:
  282.         @echo cleaning up % very carefully
  283.         -@/bin/mv %.orig /tmp/%.orig.$$ >& /dev/null
  284.  
  285. clean&:        [[sub -i X.orig X.clean *]]
  286. clean&:        [[sub -i X.frame X.vclean *]]
  287.