@echo off
if exist setenv.bat call setenv.bat
computil SetupD10
if exist setenv.bat call setenv.bat
call clean.bat
rem if not exist ..\RvLib\*.* md ..\RvLib >nul

set DCCOPTS=-H -W -Q -N..\..\D2006Win -LE..\.. -LN..\..\D2006Win -U..\..\D2006Win;..\Designer -I..\Designer -$D-,L- -V-

REM ***************************************************
REM Compile Rave Packages
REM ***************************************************
if exist ..\Designer\*.dcu del ..\Designer\*.dcu
copy ..\Designer\Rv*.res ..\..\D2006Win >nul
%NDD10%\bin\dcc32.exe ..\Designer\RvCore.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvCore.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvBarcode.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvBarcode.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvGraphics.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvGraphics.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvStandard.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvStandard.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvReport.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvReport.dcu

rem ..\RVS\RVS2INC ..\RVS\SYSFUNC.RVS ..\RVS\Rv*.rvs >nul
%NDD10%\bin\dcc32.exe ..\Designer\RvEngine.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvEngine.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvCompiler.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvCompiler.dcu

%NDD10%\bin\dcc32.exe ..\Designer\RvDesign.dpk -M %DCCOPTS% %1 %2 %3
if errorlevel 1 goto enderror
del ..\..\D2006Win\RvDesign.dcu

echo.
echo SUCCESS: Rave Packages Compiled
echo.
goto endok
:enderror
call clean
echo.
echo FAILURE: Rave Packages NOT Compiled
echo.
pause
:endok
