@echo off
echo:

rem ************************************************
rem *      Watcom C++ 10.x PTC example build       *
rem * -------------------------------------------- *
rem * Syntax: wc10x [example] (platform) (library) *
rem *                                              *
rem * [example]  = example source name             *
rem * (platform) = "dos" or "win32"                *
rem * (library)  = "debug" or "release"            *
rem ************************************************

if not exist "%1.cpp" goto done

if "%2" == "dos"   goto dos
if "%2" == "win32" goto win32




rem ****************
rem * Dos platform *
rem ****************
:dos

if "%3" == "release" goto dos-release

echo Building "%1.cpp" : Watcom C++ 10.x dos debug
echo:
wpp386 %1.cpp -i=..\src -bt=dos
wlink name %1.exe file %1.obj library ..\lib\dos\wc10.x\debug.lib system dos4g option stack=256k
goto done

:dos-release
echo Building "%1.cpp" : Watcom C++ 10.x dos release
echo:
wpp386 %1.cpp -i=..\src -bt=dos -oneatx
wlink name %1.exe file %1.obj library ..\lib\dos\wc10.x\release.lib system dos4g option stack=256k
goto done




rem ******************
rem * Win32 platform *
rem ******************
:win32

if "%3" == "release" goto win32-release

echo Building "%1.cpp" : Watcom C++ 10.x win32 debug
echo:
wpp386 %1.cpp -i=..\src -bm -bt=nt
wlink name %1.exe file %1.obj library ..\lib\win32\wc10.x\debug.lib system nt option stack=256k
goto done

:win32-release
echo Building "%1.cpp" : Watcom C++ 10.x win32 release
echo:
wpp386 %1.cpp -i=..\src -bm -bt=nt -oneatx
wlink name %1.exe file %1.obj library ..\lib\win32\wc10.x\release.lib system nt option stack=256k
goto done




:done
