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 >
Wrap
OS/2 REXX Batch file
|
1995-03-23
|
2KB
|
60 lines
/*
* Convert Metafont to C.
*/
NL = '0A'X
SEDSCRIPTNAME1 = 'amiga_script1.sed'
SEDSCRIPTNAME2 = 'amiga_script2.sed'
/*
* Prepare the SED scripts.
*/
SED1 = ': again' || NL
SED1 = SED1 || '/\.$/{' || NL
SED1 = SED1 || 'N' || NL
SED1 = SED1 || 's/\.\n/\' || NL
SED1 = SED1 || './' || NL
SED1 = SED1 || 't again' || NL
SED1 = SED1 || '}' || NL
SED1 = SED1 || 's/\.hh/.hhfield/g' || NL
SED1 = SED1 || 's/\.lh/.lhfield/g'
If ~Open('output',SEDSCRIPTNAME1,'Write') Then Do
Say "Can't open file `" || SEDSCRIPTNAME1 || "'"
Exit 10
End
Call WriteLn('output',SED1)
Call Close('output')
SED2 = 's/else write/else\' || NL
SED2 = SED2 || 'write/' || NL
SED2 = SED2 || 's/ maxcoef\( *[^( ]\)/ lmaxcoef\1/g' || NL
SED2 = SED2 || 's/ b1/ lb1/g' || NL
SED2 = SED2 || 's/ b2/ lb2/g' || NL
SED2 = SED2 || 's/ b3/ lb3/g'
If ~Open('output',SEDSCRIPTNAME2,'Write') Then Do
Say "Can't open file `" || SEDSCRIPTNAME2 || "'"
Exit 10
End
Call WriteLn('output',SED2)
Call Close('output')
/*
* OK, off we go!
*/
Address Command
"sed -f" SEDSCRIPTNAME1 "../lib/common.defines ../lib/texmf.defines ../lib/texmfextras.defines mf.p > temp_a"
"../web2c/web2c -handytexmf.h -m < temp_a > temp_b"
"sed -f" SEDSCRIPTNAME2 "temp_b > temp_c"
"../web2c/fixwrites <temp_c > temp_d"
"../web2c/regfix < temp_d > temp_e"
"../web2c/splitup < temp_e mf"
"type coerce.h andycoerce.add > xcoerce.h"
"copy xcoerce.h coerce.h"
"delete quiet xcoerce.h temp_?" SEDSCRIPTNAME1 SEDSCRIPTNAME2
Exit 0