home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc3 / Src / mf / convert < prev    next >
Encoding:
Text File  |  1993-05-16  |  1.3 KB  |  55 lines

  1. |#!/bin/sh
  2. |# Convert Metafont to C.
  3. |# 
  4. |sed=sed
  5.  
  6. |# The `volatile's in the second sed below help avoid bugs in the MIPS
  7. |# compiler.
  8. |$sed -e '
  9. |        : again
  10. |        /\.$/{
  11. |                N
  12. |                s/\.\n/\
  13. |./
  14. |                t again
  15. |        }
  16. |        s/\.hh/.hhfield/g
  17. |        s/\.lh/.lhfield/g
  18. |' ../lib/common.defines ../lib/texmf.defines mf.p \
  19. |        | ../web2c/web2c -htexmf.h -m \
  20. |        | $sed -e '
  21. |            s/else write/else\
  22. |write/
  23. |            s/ maxcoef\( *[^( ]\)/ lmaxcoef\1/g
  24. |            s/ b1/ lb1/g
  25. |            s/ b2/ lb2/g
  26. |            s/ b3/ lb3/g
  27. |            /^integer takescaled/,/becareful/s/integer becareful/volatile &/
  28. |            /^void initbignode/,/halfword q/s/halfword q/volatile &/
  29. |          ' \
  30. |        | ../web2c/fixwrites \
  31. |        | ../web2c/splitup mf
  32.  
  33. |sync
  34.  
  35. |cat coerce.h fixcoerce.h > xcoerce.h
  36. |mv xcoerce.h coerce.h
  37.  
  38. |RISC OS:
  39. echo Concatenating...
  40. fcat ^.lib.common_def ^.lib.texmf_def ^.lib.riscos_def mf.p >temp
  41. echo First sed run...
  42. sed -f SedScr1 temp >temp2
  43. echo web2c...
  44. web2c -hh.texmf -m <temp2 >temp
  45. echo second sed run...
  46. sed -f SedScr2 temp >temp2
  47. echo fixwrites...
  48. fixwrites <temp2 >temp
  49. echo splitup...
  50. splitup mf <temp
  51. fcat h.coerce h.fixcoerce >h.xcoerce
  52. copy h.xcoerce h.coerce ~CD~V
  53. remove temp
  54. remove temp2
  55.