#!/bin/sh
# Convert Metafont to C.

sed=sed

$sed -e '
	: again
	/\.$/{
		N
		s/\.\n/\
./
		t again
	}
	s/\.hh/.hhfield/g
	s/\.lh/.lhfield/g
' ../lib/common.defines ../lib/texmf.defines mf.p \
	| ../web2c/web2c -htexmf.h -m \
	| $sed -e '
	    s/else write/else\
write/
	    s/ maxcoef\( *[^( ]\)/ lmaxcoef\1/g
	    s/ b1/ lb1/g
	    s/ b2/ lb2/g
	    s/ b3/ lb3/g
	  ' \
	| ../web2c/fixwrites \
	| ../web2c/splitup mf

cat coerce.h coerce.add >xcoerce.h
mv xcoerce.h coerce.h
