@echo off

set SNACPUTYPE=%PROCESSOR_ARCHITECTURE%
if %SNACPUTYPE%==x86 SET SNACPUTYPE=I386

if not exist %1\%SNACPUTYPE%\*.* goto BAD_PARAM

rem Create debug and nodebug directories if they don't exist
if not exist %snaroot%\debug\*.* mkdir %snaroot%\debug
if not exist %snaroot%\nodebug\*.* mkdir %snaroot%\nodebug

rem Move debug files from CD and put in debug directory, if they don't already exist
cd %snaroot%
for %%f in (*.*) do replace %1\%SNACPUTYPE%\system\debug\%%f %snaroot%\debug /a 

rem Update debug files if CD versions are newer
replace %1\%SNACPUTYPE%\system\debug\*.* %snaroot%\debug /u

rem Copy nondebug versions of SNA files to nodebug directory only if not already there
cd %snaroot%\debug
for %%f in (*.*) do replace %snaroot%\%%f ..\nodebug /a

goto end

:BAD_PARAM
echo Syntax:    MAKEDBG cd_drive
echo.
echo cd_drive:  the drive letter (with colon) or UNC name of share containing 
echo.
pause

:END

