@echo off
set path=c:\bc.31\bin
if not exist bin mkdir bin

rem clean,cast,cat,dele,dl,inbox,outbox,par,pri,rep,sl,st,where

:clean
if exist bin\clean.exe del bin\clean.exe
make -fclean.mak
if exist bin\clean.exe goto cast
pause
goto done

:cast
if exist bin\cast.exe del bin\cast.exe
make -fcast.mak
if exist bin\cast.exe goto castold
pause
goto done

:castold
if exist bin\castold.exe del bin\castold.exe
make -fcastold.mak
if exist bin\castold.exe goto cat
pause
goto done

:cat
if exist bin\cat.exe del bin\cat.exe
make -fcat.mak
if exist bin\cat.exe goto catold
pause
goto done

:catold
if exist bin\catold.exe del bin\catold.exe
make -fcatold.mak
if exist bin\catold.exe goto dele
pause
goto done

:dele
if exist bin\dele.exe del bin\dele.exe
make -fdele.mak
if exist bin\dele.exe goto deleold
pause
goto done

:deleold
if exist bin\deleold.exe del bin\deleold.exe
make -fdeleold.mak
if exist bin\deleold.exe goto dl
pause
goto done

:dl
if exist bin\dl.exe del bin\dl.exe
make -fdl.mak
if exist bin\dl.exe goto dlold
pause
goto done

:dlold
if exist bin\dlold.exe del bin\dlold.exe
make -fdlold.mak
if exist bin\dlold.exe goto inbox
pause
goto done

:inbox
if exist bin\inbox.exe del bin\inbox.exe
make -finbox.mak
if exist bin\inbox.exe goto outbox
pause
goto done

:outbox
if exist bin\outbox.exe del bin\outbox.exe
make -foutbox.mak
if exist bin\outbox.exe goto par
pause
goto done

:par
if exist bin\par.exe del bin\par.exe
make -fpar.mak
if exist bin\par.exe goto parold
pause
goto done

:parold
if exist bin\parold.exe del bin\parold.exe
make -fparold.mak
if exist bin\parold.exe goto pri
pause
goto done

:pri
if exist bin\pri.exe del bin\pri.exe
make -fpri.mak
if exist bin\pri.exe goto prif
pause
goto done

:prif
if exist bin\prif.exe del bin\prif.exe
make -fprif.mak
if exist bin\prif.exe goto priold
pause
goto done

:priold
if exist bin\priold.exe del bin\priold.exe
make -fpriold.mak
if exist bin\priold.exe goto rep
pause
goto done

:rep
if exist bin\rep.exe del bin\rep.exe
make -frep.mak
if exist bin\rep.exe goto repold
pause
goto done

:repold
if exist bin\repold.exe del bin\repold.exe
make -frepold.mak
if exist bin\repold.exe goto sl
pause
goto done

:sl
if exist bin\sl.exe del bin\sl.exe
make -fsl.mak
if exist bin\sl.exe goto slold
pause
goto done

:slold
if exist bin\slold.exe del bin\slold.exe
make -fslold.mak
if exist bin\slold.exe goto st
pause
goto done

:st
if exist bin\st.exe del bin\st.exe
make -fst.mak
if exist bin\st.exe goto stold
pause
goto done

:stold
if exist bin\stold.exe del bin\stold.exe
make -fstold.mak
if exist bin\stold.exe goto where
pause
goto done

:where
if exist bin\where.exe del bin\where.exe
make -fwhere.mak
if exist bin\where.exe goto whereold
pause
goto done

:whereold
if exist bin\whereold.exe del bin\whereold.exe
make -fwhereold.mak
if exist bin\whereold.exe goto importgd
pause
goto done


:importgd
if exist bin\importgd.exe del bin\importgd.exe
make -fimportgd.mak
if exist bin\importgd.exe goto success
pause
goto done


:success
@echo on
copy bin\clean.exe ..\modules\clean.exe /y
copy bin\cast.exe ..\modules\cast.exe /y
copy bin\cat.exe ..\modules\cat.exe /y
copy bin\dele.exe ..\modules\dele.exe /y
copy bin\dl.exe ..\modules\dl.exe /y
copy bin\inbox.exe ..\modules\par.exe /y
copy bin\outbox.exe ..\modules\par.exe /y
copy bin\par.exe ..\modules\par.exe /y
copy bin\pri.exe ..\modules\pri.exe /y
copy bin\prif.exe ..\modules\prif.exe /y
copy bin\rep.exe ..\modules\rep.exe /y
copy bin\sl.exe ..\modules\sl.exe /y
copy bin\st.exe ..\modules\st.exe /y
copy bin\where.exe ..\modules\where.exe /y
copy bin\whereold.exe ..\modules\whereold.exe /y
copy bin\dlold.exe ..\modules\dlold.exe /y
copy bin\castold.exe ..\modules\castold.exe /y
copy bin\catold.exe ..\modules\catold.exe /y
copy bin\deleold.exe ..\modules\deleold.exe /y
copy bin\dlold.exe ..\modules\dlold.exe /y
copy bin\importgd.exe ..\modules\importgd.exe /y
copy bin\parold.exe ..\modules\parold.exe /y
copy bin\priold.exe ..\modules\priold.exe /y
copy bin\repold.exe ..\modules\repold.exe /y
copy bin\slold.exe ..\modules\slold.exe /y
copy bin\stold.exe ..\modules\stold.exe /y

rem copy bin\dl.exe ..\testa\modules\dl.exe /y
rem copy bin\par.exe ..\testa\modules\par.exe /y
rem copy bin\sl.exe ..\testa\modules\sl.exe /y
rem copy bin\st.exe ..\testa\modules\st.exe /y
rem copy bin\cast.exe ..\testa\modules\cast.exe /y
rem copy bin\cat.exe ..\testa\modules\cat.exe /y
rem copy bin\dele.exe ..\testa\modules\dele.exe /y
rem copy bin\importgd.exe ..\testa\modules\importgd.exe /y
rem copy bin\catold.exe ..\testa\modules\catold.exe /y
rem copy bin\pri.exe ..\testa\modules\pri.exe /y
rem copy bin\prif.exe ..\testa\modules\prif.exe /y
rem copy bin\rep.exe ..\testa\modules\rep.exe /y
rem copy bin\priold.exe ..\testa\modules\priold.exe /y
rem copy bin\repold.exe ..\testa\modules\repold.exe /y

rem clean,cast,cat,dele,dl,inbox,outbox,par,pri,rep,sl,st,where

pause
:done
