@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

:cast
if exist bin\wcast.exe del bin\wcast.exe
make -fwcast.mak
if exist bin\wcast.exe goto cat
pause
goto done

:cat
if exist bin\wcat.exe del bin\wcat.exe
make -fwcat.mak
if exist bin\wcat.exe goto dele
pause
goto done

:dele
if exist bin\wdele.exe del bin\wdele.exe
make -fwdele.mak
if exist bin\wdele.exe goto dl
pause
goto done

:dl
if exist bin\wdl.exe del bin\wdl.exe
make -fwdl.mak
if exist bin\wdl.exe goto par
pause
goto done

:par
if exist bin\wpar.exe del bin\wpar.exe
make -fwpar.mak
if exist bin\wpar.exe goto pri
pause
goto done

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

:prif
if exist bin\wprif.exe del bin\wprif.exe
make -fwprif.mak
if exist bin\wprif.exe goto rep
pause
goto done

:rep
if exist bin\wrep.exe del bin\wrep.exe
make -fwrep.mak
if exist bin\wrep.exe goto sl
pause
goto done

:sl
if exist bin\wsl.exe del bin\wsl.exe
make -fwsl.mak
if exist bin\wsl.exe goto st
pause
goto done

:st
if exist bin\wst.exe del bin\wst.exe
make -fwst.mak
if exist bin\wst.exe goto where
pause
goto done

:where
if exist bin\wwhere.exe del bin\wwhere.exe
make -fwwhere.mak
if exist bin\wwhere.exe goto success
pause
goto done

:success
@echo on
copy bin\wcast.exe ..\modules\wcast.exe /y
copy bin\wcat.exe ..\modules\wcat.exe /y
copy bin\wdele.exe ..\modules\wdele.exe /y
copy bin\wdl.exe ..\modules\wdl.exe /y
copy bin\wpar.exe ..\modules\wpar.exe /y
copy bin\wpri.exe ..\modules\wpri.exe /y
copy bin\wprif.exe ..\modules\wprif.exe /y
copy bin\wrep.exe ..\modules\wrep.exe /y
copy bin\wsl.exe ..\modules\wsl.exe /y
copy bin\wst.exe ..\modules\wst.exe /y
copy bin\wwhere.exe ..\modules\wwhere.exe /y

pause
:done
