home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / mf / convert.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-23  |  2KB  |  60 lines

  1. /*
  2.  * Convert Metafont to C.
  3.  */
  4.  
  5. NL = '0A'X
  6.  
  7. SEDSCRIPTNAME1 = 'amiga_script1.sed'
  8. SEDSCRIPTNAME2 = 'amiga_script2.sed'
  9.  
  10. /*
  11.  * Prepare the SED scripts.
  12.  */
  13. SED1 =         ': again'           || NL
  14. SED1 = SED1 || '/\.$/{'            || NL
  15. SED1 = SED1 || 'N'                 || NL
  16. SED1 = SED1 || 's/\.\n/\'          || NL
  17. SED1 = SED1 || './'                || NL
  18. SED1 = SED1 || 't again'           || NL
  19. SED1 = SED1 || '}'                 || NL
  20. SED1 = SED1 || 's/\.hh/.hhfield/g' || NL
  21. SED1 = SED1 || 's/\.lh/.lhfield/g'
  22. If ~Open('output',SEDSCRIPTNAME1,'Write') Then Do
  23.   Say "Can't open file `" || SEDSCRIPTNAME1 || "'"
  24.   Exit 10
  25. End
  26. Call WriteLn('output',SED1)
  27. Call Close('output')
  28.  
  29. SED2 =         's/else write/else\'                  || NL
  30. SED2 = SED2 || 'write/'                              || NL
  31. SED2 = SED2 || 's/ maxcoef\( *[^( ]\)/ lmaxcoef\1/g' || NL
  32. SED2 = SED2 || 's/ b1/ lb1/g'                        || NL
  33. SED2 = SED2 || 's/ b2/ lb2/g'                        || NL
  34. SED2 = SED2 || 's/ b3/ lb3/g'
  35. If ~Open('output',SEDSCRIPTNAME2,'Write') Then Do
  36.   Say "Can't open file `" || SEDSCRIPTNAME2 || "'"
  37.   Exit 10
  38. End
  39. Call WriteLn('output',SED2)
  40. Call Close('output')
  41.  
  42. /*
  43.  * OK, off we go!
  44.  */
  45. Address Command
  46.  
  47. "sed -f" SEDSCRIPTNAME1 "../lib/common.defines ../lib/texmf.defines ../lib/texmfextras.defines mf.p > temp_a"
  48. "../web2c/web2c -handytexmf.h -m < temp_a > temp_b"
  49. "sed -f" SEDSCRIPTNAME2 "temp_b > temp_c"
  50. "../web2c/fixwrites <temp_c > temp_d"
  51. "../web2c/regfix < temp_d > temp_e"
  52. "../web2c/splitup < temp_e mf"
  53.  
  54. "type coerce.h andycoerce.add > xcoerce.h"
  55. "copy xcoerce.h coerce.h"
  56.  
  57. "delete quiet xcoerce.h temp_?" SEDSCRIPTNAME1 SEDSCRIPTNAME2
  58.  
  59. Exit 0
  60.