echo off
rem gfmt.cmd
if exist hyphen.tex goto ex
if exist plaing.tex goto ex
if exist lplaing.tex goto ex
if exist lhyphen.tex goto ex
copy \emtex\texinput\plain.tex plaing.tex
copy \emtex\texinput\ghyphen.max hyphen.tex
btexp -i -c850_tex -mt12000 \language1\input plaing \dump
if errorlevel 1 goto error
copy \emtex\texinput\lplain.tex lplaing.tex
copy \emtex\texinput\lhyphen.ger lhyphen.tex
btexp -i -c850_tex -mt12000 lplaing \dump
if errorlevel 1 goto error
goto done

:ex
echo The following files should be removed or renamed before running fmt:
if exist hyphen.tex echo hyphen.tex
if exist plaing.tex echo plaing.tex
if exist lplaing.tex echo lplaing.tex
if exist lhyphen.tex echo lhyphen.tex
goto end

:error
echo Error

:done
if exist hyphen.tex del hyphen.tex
if exist plaing.tex del plaing.tex
if exist lplaing.tex del lplaing.tex
if exist lhyphen.tex del lhyphen.tex
:end
