@echo off

:start

REM SatLink Executable
del /Q satlink.exe
cd satlink
call mk.bat
call clean.bat
cd ..
if not exist satlink.exe goto err

REM Tools
cd tools
call mk.bat
cd ..


REM SatCom FirmWare
del /Q SCFirmWare\cd\0.bin
cd SCFirmWare
call mk.bat src
call mk.bat r
cd ..
if not exist SCFirmWare\cd\0.bin goto err


REM ietx2
del /Q ietx2\cd\0.bin
cd ietx2
call mk.bat src
call mk.bat rr
cd ..
if not exist ietx2\cd\0.bin goto err


goto inputcmd
:err
echo BUILD ERROR !

:inputcmd
echo --------------------------------------------
echo  Type `e' to end.
echo  Type `r' to rebuild all.
set cm=dummy
set /P cm="Command: "

:parsecommand
If "%cm%" == "r" goto start
goto end


:end
