@echo off

rem ******************************************************************
rem * This is a wrapper for makerelease.cmd
rem * It's used to make the inbuild distribution of the driver
rem * The NTD*** environment vars are set per MS for inbuild drivers
rem ******************************************************************

if "%1"=="" goto Usage
if NOT "%3"=="" goto Usage

if "%DDKBUILDENV%"==""          goto ExitNotBuildWindow
if "%DDKBUILDENV%"=="checked"   goto BuildChecked
if "%DDKBUILDENV%"=="free"      goto BuildFree
goto ExitNotBuildWindow

:BuildChecked
echo Generating checked build release for In Build Project
set NTDEBUG=ntsd
set NTDBGFILES=
set NTDEBUGTYPE=windbg
set BINPLACE_FLAGS=
goto BuildIt

:BuildFree
echo Generating retail build release for In Build Project
set NTDEBUG=
set NTDBGFILES=
set NTDEBUGTYPE=windbg
set BINPLACE_FLAGS=
goto BuildIt

:BuildIt
call makerelease %1 %2
if ERRORLEVEL 1 goto MakeReleaseError
goto Done

:MakeReleaseError
echo *****************************
echo *!    MakeRelease Error    !*
echo *****************************
goto QuietExit

:ExitNotBuildWindow
echo *****************************
echo *! Corrupted build window  !*
echo *****************************
goto QuietExit

:Usage
echo Usage:
echo   inbuildrelease ^<VSS path^> ^<VSS tag^>
goto QuietExit

:Done
echo *************************************************************
echo * Use CopyRelease with InBuild.lst to copy the distribution *
echo *************************************************************

:QuietExit
