@echo off
set tex=tex386
goto %1
goto end

:all
call makedvi gcc
call makedvi gxxint
call makedvi gdb
call makedvi gdbint
call makedvi gas
call makedvi texinfo
call makedvi libgpp
call makedvi iostream
call makedvi binutils
call makedvi termcap
goto end

:gcc
setlocal
set texinput=gcc
call texi2dvi gcc/gcc.tex
del gcc.aux gcc.cp gcc.cps gcc.fn gcc.ky gcc.kys gcc.log gcc.pg 2>nul
del gcc.toc gcc.tp gcc.vr 2>nul
call texi2dvi gcc/cpp.tex
del cpp.aux cpp.cp cpp.cps cpp.fn cpp.fns cpp.ky cpp.log cpp.pg 2>nul
del cpp.toc cpp.tp cpp.vr 2>nul
endlocal
goto end

:gxxint
setlocal
set texinput=gcc
call texi2dvi gcc/gxxint.tex
del gxxint.aux gxxint.cp gxxint.cps gxxint.fn gxxint.ky gxxint.log 2>nul
del gxxint.pg gxxint.toc gxxint.tp gxxint.vr 2>nul
endlocal
goto end

:gdb
setlocal
set texinput=gdb
%tex% gdb/refcard
del refcard.log
call texi2dvi gdb/gdb.tex
del gdb.aux gdb.cp gdb.cps gdb.fn gdb.fns gdb.ky 2>nul
del gdb.log gdb.pg gdb.toc gdb.tp gdb.vr 2>nul
endlocal
goto end

:gdbint
setlocal
set texinput=gdb
call texi2dvi gdb/gdbint.tex
del gdbint.aux gdbint.cp gdbint.fn gdbint.ky gdbint.log gdbint.pg 2>nul
del gdbint.toc gdbint.tp gdbint.vr 2>nul
call texi2dvi gdb/stabs.tex
del stabs.aux stabs.cp stabs.fn stabs.fns stabs.ky stabs.log stabs.pg 2>nul
del stabs.toc stabs.tp stabs.vr
call texi2dvi gdb/annotate.tex
del annotate.aux annotate.cp annotate.fn annotate.fns annotate.ky
del annotate.log annotate.pg annotate.toc annotate.tp annotate.vr
endlocal
goto end

:gas
setlocal
set texinput=gas
call texi2dvi gas/as.tex
del as.aux as.cp as.cps as.fn as.ky as.log as.pg as.toc as.tp as.vr 2>nul
call texi2dvi gas/gasp.tex
del gasp.aux gasp.cp gasp.cps gasp.fn gasp.ky gasp.log gasp.pg 2>nul
del gasp.toc gasp.tp gasp.vr 2>nul
endlocal
goto end

:texinfo
setlocal
set texinput=texinfo
call texi2dvi texinfo/info-stn.tex
del info-stn.aux info-stn.cp info-stn.cps info-stn.fn 2>nul
del info-stn.ky info-stn.log info-stn.pg info-stn.toc info-stn.tp 2>nul
del info-stn.vr 2>nul
call texi2dvi texinfo/texi.tex
del texi.aux texi.cp texi.cps texi.fn texi.fns 2>nul
del texi.ky texi.log texi.pg texi.toc texi.tp 2>nul
del texi.vr 2>nul
call texi2dvi texinfo/makeinfo.tex
del makeinfo.aux makeinfo.cp makeinfo.cps makeinfo.fn 2>nul
del makeinfo.ky makeinfo.log makeinfo.pg makeinfo.toc makeinfo.tp 2>nul
del makeinfo.vr 2>nul
endlocal
goto end

:libgpp
setlocal
set texinput=libgpp
call texi2dvi libgpp/libgpp.tex
del libgpp.aux libgpp.cp libgpp.fn libgpp.fns libgpp.ky libgpp.log 2>nul
del libgpp.pg libgpp.toc libgpp.tp libgpp.vr 2>nul
endlocal
goto end

:gppfaq
setlocal
set texinput=gcc
call texi2dvi gcc/gppfaq.tex
del gppfaq.aux gppfaq.cp gppfaq.cps gppfaq.fn gppfaq.ky gppfaq.log 2>nul
del gppfaq.pg gppfaq.toc gppfaq.tp gppfaq.vr 2>nul
endlocal
goto end

:iostream
setlocal
set texinput=stdcpp
call texi2dvi stdcpp/iostream.tex
del iostream.aux iostream.cp iostream.cps iostream.fn iostream.ky 2>nul
del iostream.log iostream.pg iostream.toc iostream.tp iostream.vr 2>nul
endlocal
goto end

:binutils
setlocal
set texinput=binutils
call texi2dvi binutils/binutils.tex
del binutils.aux binutils.cp binutils.cps binutils.fn binutils.ky 2>nul
del binutils.log binutils.pg binutils.toc binutils.tp binutils.vr 2>nul
call texi2dvi binutils/gprof.tex
del gprof.aux gprof.cp gprof.cps gprof.fn gprof.ky 2>nul
del gprof.log gprof.pg gprof.toc gprof.tp gprof.vr 2>nul
endlocal
goto end

:termcap
setlocal
set texinput=termcap
call texi2dvi termcap/termcap.tex
del termcap.aux termcap.cp termcap.cps termcap.fn termcap.fns termcap.ky 2>nul
del termcap.kys termcap.log termcap.pg termcap.toc termcap.tp termcap.vr 2>nul
endlocal
goto end

:end
