@echo off
:begin
if exist %IWPROJ%\scripts\env.bat call %IWPROJ%\scripts\env.bat
if exist env.bat call env.bat
cls
echo Main Menu   ** %1 **
echo -----------------------------------------
echo A) kernels
echo B) applications
echo C) sbos
echo D) windows
echo E) win '95 vxd
echo F) tools
echo G) build all
echo H) copy distribution files
echo I) build all and copy distribution files
echo Q) QUIT
echo -----------------------------------------
choice /C:abcdefghiq
if errorlevel 10 goto end
if errorlevel 9 goto dist
if errorlevel 8 goto copy
if errorlevel 7 goto all
if errorlevel 6 goto tools
if errorlevel 5 goto win95vxd
if errorlevel 4 goto win
if errorlevel 3 goto sbos
if errorlevel 2 goto apps
if errorlevel 1 goto kernel
goto end


rem ******************
rem BUILD KERNELS
rem ******************

:kernel
cls
echo Build Kernels   ** %1 **
echo ---------------------------------
echo A) borland kernel(s)
echo B) microsoft(6) kernel(s)
echo C) microsoft(8) kernel(s)
echo D) watcom kernel(s)
echo E) os2 kernel
echo F) all kernels
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abcdemq
if errorlevel 7 goto end
if errorlevel 6 goto begin
if errorlevel 5 goto allknls
if errorlevel 4 goto watcom
if errorlevel 3 goto ms8
if errorlevel 2 goto ms6
if errorlevel 1 goto borland
goto end

rem *********************
rem BUILD BORLAND KERNELS
rem *********************

:borland
cls
echo Build Borland Kernels   ** %1 **
echo ---------------------------------
echo A) tiny model
echo B) large model
echo C) compact model
echo D) small model
echo E) medium model
echo F) b4 tiny model
echo G) b4 large model
echo K) KERNEL MENU
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abcdefgkmq
if errorlevel 10 goto end
if errorlevel 9 goto begin
if errorlevel 8 goto kernel
if errorlevel 7 goto b4large
if errorlevel 6 goto b4tiny
if errorlevel 5 goto osmed
if errorlevel 4 goto ossmall
if errorlevel 3 goto oscomp
if errorlevel 2 goto oslarge
if errorlevel 1 goto ostiny
goto kernel

:ostiny
sh %IWPROJ%\scripts\krnbld.ksh ost %1
pause
goto borland

:oslarge
sh %IWPROJ%\scripts\krnbld.ksh osl %1
pause
goto borland

:oscomp
sh %IWPROJ%\scripts\krnbld.ksh osc %1
pause
goto borland

:ossmall
sh %IWPROJ%\scripts\krnbld.ksh oss %1
pause
goto borland

:osmed
sh %IWPROJ%\scripts\krnbld.ksh osm %1
pause
goto borland

:b4tiny
sh %IWPROJ%\scripts\krnbld.ksh osb4t %1
pause
goto borland

:b4large
sh %IWPROJ%\scripts\krnbld.ksh osb4l %1
pause
goto borland

rem **************************
rem BUILD MICROSOFT(6) KERNELS
rem **************************

:ms6
cls
echo Build Microsoft(6) Kernels   ** %1 **
echo ---------------------------------
echo A) tiny model
echo B) large model
echo K) KERNEL MENU
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abkmq
if errorlevel 5 goto end
if errorlevel 4 goto begin
if errorlevel 3 goto kernel
if errorlevel 2 goto ms6large
if errorlevel 1 goto ms6tiny
goto kernel

:ms6tiny
sh %IWPROJ%\scripts\krnbld.ksh ms6t %1
pause
goto ms6

:ms6large
sh %IWPROJ%\scripts\krnbld.ksh ms6l %1
pause
goto ms6


rem **************************
rem BUILD MICROSOFT(8) KERNELS
rem **************************

:ms8
cls
echo Build Microsoft(8) Kernels   ** %1 **
echo ---------------------------------
echo A) tiny model
echo B) large model
echo C) dll medium model
echo K) KERNEL MENU
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abckmq
if errorlevel 6 goto end
if errorlevel 5 goto begin
if errorlevel 4 goto kernel
if errorlevel 3 goto ms8dllm
if errorlevel 2 goto ms8large
if errorlevel 1 goto ms8tiny
goto kernel

:ms8tiny
sh %IWPROJ%\scripts\krnbld.ksh ms8t %1
pause
goto ms8

:ms8large
sh %IWPROJ%\scripts\krnbld.ksh ms8l %1
pause
goto ms8

:ms8dllm
sh %IWPROJ%\scripts\krnbld.ksh msdllm %1
pause
goto ms8


rem **************************
rem BUILD WATCOM KERNELS
rem **************************

:watcom
cls
echo Build Watcom Kernels   ** %1 **
echo ---------------------------------
echo A) watcom
echo B) lucid
echo K) KERNEL MENU
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abkmq
if errorlevel 5 goto end
if errorlevel 4 goto begin
if errorlevel 3 goto kernel
if errorlevel 2 goto lucid
if errorlevel 1 goto wc
goto kernel

:wc
sh %IWPROJ%\scripts\krnbld.ksh watcom %1
pause
goto watcom

:lucid
sh %IWPROJ%\scripts\krnbld.ksh lucid %1
pause
goto watcom


rem **************************
rem BUILD OS2 KERNEL
rem **************************

:os2
sh %IWPROJ%\scripts\krnbld.ksh os2 %1
pause
goto kernel


rem **************************
rem BUILD ALL KERNELS
rem **************************

:allknls
sh %IWPROJ%\scripts\krnbld.ksh allkernels %1
pause
goto kernel


rem ******************
rem BUILD APPLICATIONS
rem ******************

:apps
cls
echo Build Applications   ** %1 **
echo ---------------------------------
echo A) iwinit
echo B) play
echo C) install
echo D) all applications
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abcdmq
if errorlevel 6 goto end
if errorlevel 5 goto begin
if errorlevel 4 goto allapps
if errorlevel 3 goto install
if errorlevel 2 goto play
if errorlevel 1 goto iwinit
goto begin

:iwinit
sh %IWPROJ%\scripts\appbld.ksh iwinit %1
pause
goto apps

:play
sh %IWPROJ%\scripts\appbld.ksh play %1
pause
goto apps

:install
sh %IWPROJ%\scripts\instbld.ksh
pause
goto apps

:allapps
sh %IWPROJ%\scripts\appbld.ksh apps %1
pause
goto apps


rem ******************
rem BUILD SBOS
rem ******************

:sbos
sh %IWPROJ%\scripts\sbosbld.ksh %1
pause
goto begin


rem ******************
rem BUILD WINDOWS
rem ******************

:win
cls
echo Build Windows   ** %1 **
echo ---------------------------------
echo A) vxd
echo B) windows
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abmq
if errorlevel 4 goto end
if errorlevel 3 goto begin
if errorlevel 2 goto winbld
if errorlevel 1 goto vxd
goto begin

:vxd
sh %IWPROJ%\scripts\vxdbld.ksh win %1
pause
goto win

:winbld
sh %IWPROJ%\scripts\winbld.ksh %1
pause
goto win

:win95vxd
sh %IWPROJ%\scripts\vxdbld.ksh win95 %1
rem ******************
rem BUILD APPLICATIONS
rem ******************

:tools
cls
echo Build Tools   ** %1 **
echo ---------------------------------
echo A) rommaker
echo B) mlscomp
echo C) all tools
echo M) MAIN MENU
echo Q) QUIT
echo ---------------------------------
choice /C:abcmq
if errorlevel 5 goto end
if errorlevel 4 goto begin
if errorlevel 3 goto alltools
if errorlevel 2 goto mls
if errorlevel 1 goto rom
goto begin

:rom
sh %IWPROJ%\scripts\toolbld.ksh rom %1
pause
goto tools

:mls
sh %IWPROJ%\scripts\toolbld.ksh mls %1
pause
goto tools

:alltools
sh %IWPROJ%\scripts\toolbld.ksh all %1
pause
goto tools

rem ******************
rem BUILD ALL
rem ******************

:all

sh %IWPROJ%\scripts\toolbld.ksh all %1
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\appbld.ksh apps %1
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\sbosbld.ksh %1
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\vxdbld.ksh win %1
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\winbld.ksh %1
if errorlevel 1 pause; goto begin

goto begin

rem *****************************************************
rem COPY DISTRIBUTION FILES TO $IWPROJ\DIST
rem *****************************************************

:copy

sh %IWPROJ%\scripts\appbld.ksh apps dist
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\sbosbld.ksh dist
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\vxdbld.ksh win dist
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\winbld.ksh dist
if errorlevel 1 pause; goto begin

rem sh %IWPROJ%\scripts\toolbld.ksh all dist
rem if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\binary.ksh dist
if errorlevel 1 pause; goto begin
goto begin

rem *****************************************************
rem BUILD ALL AND COPY DISTRIBUTION FILES TO $IWPROJ\DIST
rem *****************************************************

:dist

sh %IWPROJ%\scripts\toolbld.ksh all
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\appbld.ksh apps cleanall
sh %IWPROJ%\scripts\appbld.ksh apps
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\sbosbld.ksh clean
sh %IWPROJ%\scripts\sbosbld.ksh
if errorlevel 1 pause; goto begin

sh %IWPROJ%\scripts\vxdbld.ksh win clean
sh %IWPROJ%\scripts\vxdbld.ksh win %1

sh %IWPROJ%\scripts\winbld.ksh clean
sh %IWPROJ%\scripts\winbld.ksh
if errorlevel 1 pause; goto begin

goto copy

:end
cd %IWPROJ%\scripts
