Skip to content

Commit

Permalink
Deployment scripts: use copy when cp is not present.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Mar 11, 2016
1 parent 435918a commit be04304
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 56 deletions.
44 changes: 26 additions & 18 deletions xrbinprep.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,46 @@ if not exist %game_root% (
echo path not found: %game_root%
goto ret
)
set game_root=!game_root:"=!
for /f "delims=" %%a in ('chdir') do set git_root=%%a
set git_root="%git_root%"
pushd %game_root%
set bin_dbg_win32=_bin_dbg_Win32
set bin_mix_win32=_bin_mix_Win32
set bin_rel_win32=_bin_rel_Win32
set xbin=%bin_dbg_win32% %bin_mix_win32% %bin_rel_win32%

where cp >nul 2>nul
if %errorLevel% neq 0 (
set cp_tool=copy /Y
) else (
set cp_tool=cp
)

for %%b in (%xbin%) do (
if not exist %%b (
mkdir %%b
)
if not exist %%b\dedicated (
mkdir %%b\dedicated
)
cp bin\dbghelp.dll %%b\dbghelp.dll
cp bin\eax.dll %%b\eax.dll
cp bin\wrap_oal.dll %%b\wrap_oal.dll
cp bin\eax.dll %%b\dedicated\eax.dll
cp bin\wrap_oal.dll %%b\dedicated\wrap_oal.dll
cp %git_root%\src\Externals\OpenSSL\bin\libeay32.dll %%b\libeay32.dll
cp %git_root%\src\Externals\OpenSSL\bin\ssleay32.dll %%b\ssleay32.dll
%cp_tool% bin\dbghelp.dll %%b\dbghelp.dll
%cp_tool% bin\eax.dll %%b\eax.dll
%cp_tool% bin\wrap_oal.dll %%b\wrap_oal.dll
%cp_tool% bin\eax.dll %%b\dedicated\eax.dll
%cp_tool% bin\wrap_oal.dll %%b\dedicated\wrap_oal.dll
%cp_tool% "%git_root%\src\Externals\OpenSSL\bin\libeay32.dll" %%b\libeay32.dll
%cp_tool% "%git_root%\src\Externals\OpenSSL\bin\ssleay32.dll" %%b\ssleay32.dll
)
cp %git_root%\src\Externals\BugTrap\bin\BugTrapD.dll %bin_dbg_win32%\BugTrap.dll
cp %git_root%\src\Externals\BugTrap\bin\BugTrap.dll %bin_mix_win32%\BugTrap.dll
cp %git_root%\src\Externals\BugTrap\bin\BugTrap.dll %bin_rel_win32%\BugTrap.dll
%cp_tool% "%git_root%\src\Externals\BugTrap\bin\BugTrapD.dll" %bin_dbg_win32%\BugTrap.dll
%cp_tool% "%git_root%\src\Externals\BugTrap\bin\BugTrap.dll" %bin_mix_win32%\BugTrap.dll
%cp_tool% "%git_root%\src\Externals\BugTrap\bin\BugTrap.dll" %bin_rel_win32%\BugTrap.dll
if exist gamedata (
echo gamedata already exists. Remove/rename it, then
echo create soft link to "%git_root%\res\gamedata"
echo -or-
echo run this script again
) else (
mklink /D gamedata %git_root%\res\gamedata
mklink /D gamedata "%git_root%\res\gamedata"
)
popd
call :make_binup Win32 Debug
Expand All @@ -63,12 +71,12 @@ set platform=%~1
set conf=%~2
set fname=.xrbinup_%conf%_%platform%.cmd
( ^
echo @echo off && ^
echo setlocal && ^
echo set src=%git_root% && ^
echo set dst=%game_root% && ^
echo call xrbinup.cmd %%dst%% %%src%% %platform% %conf% && ^
echo endlocal ) ^
echo @echo off&& ^
echo setlocal&& ^
echo set src=%git_root%&& ^
echo set dst=!game_root!&& ^
echo call xrbinup.cmd "%%dst%%" "%%src%%" %platform% %conf%&& ^
echo endlocal) ^
> %fname%
endlocal
goto:eof
Expand Down
85 changes: 47 additions & 38 deletions xrbinup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,65 +33,74 @@ goto ret
:platform_ok
set cfg=%4
if %cfg%==Debug (
set dst=%1\_bin_dbg
set dst=%1
set dst=!dst:"=!\_bin_dbg
goto cfg_ok
)
if %cfg%==Mixed (
set dst=%1\_bin_mix
set dst=%1
set dst=!dst:"=!\_bin_mix
goto cfg_ok
)
if %cfg%==Release (
set dst=%1\_bin_rel
set dst=%1
set dst=!dst:"=!\_bin_rel
goto cfg_ok
)
echo invalid configuration: %cfg%
goto ret

:cfg_ok
set dst=%dst%_%platform%
set src=%2\bin\%platform%\%cfg%
set dst=!dst!_%platform%
set src=%2
set src=!src:"=!\bin\%platform%\%cfg%

set cp_tool=cp
where cp >nul 2>nul
if %errorLevel% neq 0 (
set cp_tool=copy /Y
) else (
set cp_tool=cp
)

%cp_tool% %src%\xrEngine.exe %dst%\xrEngine.exe
%cp_tool% %src%\xrAPI.dll %dst%\xrAPI.dll
%cp_tool% %src%\xrCore.dll %dst%\xrCore.dll
%cp_tool% %src%\xrCDB.dll %dst%\xrCDB.dll
%cp_tool% %src%\xrSound.dll %dst%\xrSound.dll
%cp_tool% %src%\xrParticles.dll %dst%\xrParticles.dll
%cp_tool% %src%\xrPhysics.dll %dst%\xrPhysics.dll
%cp_tool% %src%\xrD3D9-Null.dll %dst%\xrD3D9-Null.dll
%cp_tool% %src%\xrAICore.dll %dst%\xrAICore.dll
%cp_tool% %src%\xrScriptEngine.dll %dst%\xrScriptEngine.dll
%cp_tool% %src%\xrGame.dll %dst%\xrGame.dll
%cp_tool% %src%\xrGameSpy.dll %dst%\xrGameSpy.dll
%cp_tool% %src%\xrNetServer.dll %dst%\xrNetServer.dll
%cp_tool% %src%\xrRender_R1.dll %dst%\xrRender_R1.dll
%cp_tool% %src%\xrRender_R2.dll %dst%\xrRender_R2.dll
%cp_tool% %src%\xrRender_R3.dll %dst%\xrRender_R3.dll
%cp_tool% %src%\xrRender_R4.dll %dst%\xrRender_R4.dll
%cp_tool% %src%\xrRender_GL.dll %dst%\xrRender_GL.dll
%cp_tool% "!src!\xrEngine.exe" "!dst!\xrEngine.exe"
%cp_tool% "!src!\xrAPI.dll" "!dst!\xrAPI.dll"
%cp_tool% "!src!\xrCore.dll" "!dst!\xrCore.dll"
%cp_tool% "!src!\xrCDB.dll" "!dst!\xrCDB.dll"
%cp_tool% "!src!\xrSound.dll" "!dst!\xrSound.dll"
%cp_tool% "!src!\xrParticles.dll" "!dst!\xrParticles.dll"
%cp_tool% "!src!\xrPhysics.dll" "!dst!\xrPhysics.dll"
%cp_tool% "!src!\xrD3D9-Null.dll" "!dst!\xrD3D9-Null.dll"
%cp_tool% "!src!\xrAICore.dll" "!dst!\xrAICore.dll"
%cp_tool% "!src!\xrScriptEngine.dll" "!dst!\xrScriptEngine.dll"
%cp_tool% "!src!\xrGame.dll" "!dst!\xrGame.dll"
%cp_tool% "!src!\xrGameSpy.dll" "!dst!\xrGameSpy.dll"
%cp_tool% "!src!\xrNetServer.dll" "!dst!\xrNetServer.dll"
%cp_tool% "!src!\xrRender_R1.dll" "!dst!\xrRender_R1.dll"
%cp_tool% "!src!\xrRender_R2.dll" "!dst!\xrRender_R2.dll"
%cp_tool% "!src!\xrRender_R3.dll" "!dst!\xrRender_R3.dll"
%cp_tool% "!src!\xrRender_R4.dll" "!dst!\xrRender_R4.dll"
%cp_tool% "!src!\xrRender_GL.dll" "!dst!\xrRender_GL.dll"
if %platform%==Win32 (
%cp_tool% %src%\amd_ags_x86.dll %dst%\amd_ags_x86.dll
%cp_tool% "!src!\amd_ags_x86.dll" "!dst!\amd_ags_x86.dll"
)
if %platform%==Win64 (
%cp_tool% %src%\amd_ags_x64.dll %dst%\amd_ags_x64.dll
%cp_tool% "!src!\amd_ags_x64.dll" "!dst!\amd_ags_x64.dll"
)
%cp_tool% %src%\xrXMLParser.dll %dst%\xrXMLParser.dll
%cp_tool% "!src!\xrXMLParser.dll" "!dst!\xrXMLParser.dll"
rem CxImage is compiled as DLLs only in debug configuration
if %cfg%==Debug (
%cp_tool% %src%\CxImage.dll %dst%\CxImage.dll
%cp_tool% "!src!\CxImage.dll" "!dst!\CxImage.dll"
)
%cp_tool% %src%\LuaJIT.dll %dst%\LuaJIT.dll
%cp_tool% %src%\luabind.dll %dst%\luabind.dll
%cp_tool% %src%\ODE.dll %dst%\ODE.dll
%cp_tool% %src%\OpenAL32.dll %dst%\OpenAL32.dll
%cp_tool% %src%\OpenAL32.dll %dst%\dedicated\OpenAL32.dll
%cp_tool% %src%_Dedicated\dedicated\xrEngine.exe %dst%\dedicated\xrEngine.exe
%cp_tool% %src%\xrWeatherEditor.dll %dst%\xrWeatherEditor.dll
%cp_tool% %src%\xrManagedApi.dll %dst%\xrManagedApi.dll
%cp_tool% %src%\xrSdkControls.dll %dst%\xrSdkControls.dll
%cp_tool% %src%\xrPostprocessEditor.exe %dst%\xrPostprocessEditor.exe
%cp_tool% "!src!\LuaJIT.dll" "!dst!\LuaJIT.dll"
%cp_tool% "!src!\luabind.dll" "!dst!\luabind.dll"
%cp_tool% "!src!\ODE.dll" "!dst!\ODE.dll"
%cp_tool% "!src!\OpenAL32.dll" "!dst!\OpenAL32.dll"
%cp_tool% "!src!\OpenAL32.dll" "!dst!\dedicated\OpenAL32.dll"
%cp_tool% "!src!_Dedicated\dedicated\xrEngine.exe" "!dst!\dedicated\xrEngine.exe"
%cp_tool% "!src!\xrWeatherEditor.dll" "!dst!\xrWeatherEditor.dll"
%cp_tool% "!src!\xrManagedApi.dll" "!dst!\xrManagedApi.dll"
%cp_tool% "!src!\xrSdkControls.dll" "!dst!\xrSdkControls.dll"
%cp_tool% "!src!\xrPostprocessEditor.exe" "!dst!\xrPostprocessEditor.exe"

:ret
endlocal

0 comments on commit be04304

Please sign in to comment.