@echo off
\dev\tools\deltree /y d:\dev\temp\tmp_*.* >nul

ECHO GoRC...
CD res
\dev\tools\gorc /r /ni /nw /fo \dev\temp\tmp_exe.res exe.rc
\dev\tools\gorc /r /ni /nw /fo \dev\temp\tmp_lnen.res lng_en.rc
\dev\tools\gorc /r /ni /nw /fo \dev\temp\tmp_lnde.res lng_de.rc
\dev\tools\gorc /r /ni /nw /fo \dev\temp\tmp_twin.res thm_win.rc
\dev\tools\gorc /r /ni /nw /fo \dev\temp\tmp_ttng.res thm_tng.rc

REM \dev\tools\rc\rc /fo \dev\temp\tmp_exe.res exe.rc
REM \dev\tools\rc\rc /fo \dev\temp\tmp_lnen.res lng_en.rc
REM \dev\tools\rc\rc /fo \dev\temp\tmp_lnde.res lng_de.rc
REM \dev\tools\rc\rc /fo \dev\temp\tmp_twin.res thm_win.rc
REM \dev\tools\rc\rc /fo \dev\temp\tmp_ttng.res thm_tng.rc
REM copy mainicon.res \dev\temp\tmp_vico.res

ECHO FAsm...
copy lng_en.fasm \dev\temp\tmp_lnen.asm /y >NUL
copy lng_de.fasm \dev\temp\tmp_lnde.asm /y >NUL
copy thm_win.fasm \dev\temp\tmp_twin.asm /y >NUL
copy thm_tng.fasm \dev\temp\tmp_ttng.asm /y >NUL

\dev\tools\fasmc \dev\temp\tmp_lnen.asm
\dev\tools\fasmc \dev\temp\tmp_lnde.asm
\dev\tools\fasmc \dev\temp\tmp_twin.asm
\dev\tools\fasmc \dev\temp\tmp_ttng.asm

ECHO Exe...
cd \dev\temp
start /w \dev\tools\runvb6w /make \dev\software\Projects\Calaym\Calaym.vbp /out \dev\temp
start /w \dev\tools\rhacker\rhacker.exe -delete tmp_cp.exe, tmp_exe1.exe,,,
start /w \dev\tools\rhacker\rhacker.exe -add tmp_exe1.exe, tmp_exe3.exe, tmp_exe.res,,,
REM start /w \dev\tools\rhacker\rhacker.exe -add tmp_exe2.exe, tmp_exe3.exe, tmp_vico.res,,,

ECHO PostVFix...
\dev\tools\PostVFix.exe \dev\temp\tmp_lnen.dll \dev\temp\tmp_lnen.lng
\dev\tools\PostVFix.exe \dev\temp\tmp_lnde.dll \dev\temp\tmp_lnde.lng
\dev\tools\PostVFix.exe \dev\temp\tmp_twin.dll \dev\temp\tmp_twin.icl
\dev\tools\PostVFix.exe \dev\temp\tmp_ttng.dll \dev\temp\tmp_ttng.icl
\dev\tools\PostVFix.exe \dev\temp\tmp_exe3.exe \dev\temp\tmp_exe3.vfx

ECHO Upx...
\dev\tools\upx -qqq --best \dev\temp\tmp_*.lng
\dev\tools\upx -qqq --best \dev\temp\tmp_*.icl
\dev\tools\upx -qqq --best \dev\temp\tmp_*.vfx

ECHO Copy...
cd \dev\software\projects\calaym\redist\allfiles
copy /y \dev\temp\tmp_lnen.lng vb6.lng >NUL
copy /y \dev\temp\tmp_lnde.lng ger_Calaym.lng >NUL
copy /y \dev\temp\tmp_ttng.icl icl_tango.icl >NUL
\dev\tools\copytovb \dev\temp\tmp_lnen.lng
\dev\tools\copytovb \dev\temp\tmp_twin.icl
copy /y \dev\temp\tmp_exe3.vfx Calaym.exe >NUL
copy /y \dev\temp\tmp_twin.icl vb6.icl >NUL

ECHO Layer...
call \dev\software\libraries\ctsslay\#makeAll.bat

cd \dev\software\projects\calaym\redist\allfiles
@copy \dev\software\projects\Calaym\helpen\Calaym.hlp Calaym.hlp >NUL
@copy \dev\software\projects\Calaym\chmen\Calaym.chm Calaym.chm >NUL
@copy \dev\software\projects\Calaym\helpde\Calaym.hlp CalaymDE.hlp >NUL
@copy \dev\software\projects\Calaym\chmde\Calaym.chm CalaymDE.chm >NUL
@copy \dev\software\libraries\ctsslay\bin\*.lay >NUL
@copy \dev\software\libraries\ctsslay\bin\*.dll >NUL
echo Done.