KAZIK/build.bat
Artvasil09 3ad5bf4c9d Develop assembly-only casino scenes and native games
Add native Durak, poker, blackjack, roulette, Buckshot and billiards scenes with animation assets and regression tests. Improve arrival, city, hall, profiles, shops, audio and exit handling; remove the portable C game core and refresh shipping executables.
2026-10-08 22:39:19 +03:00

70 lines
2.4 KiB
Batchfile

@echo off
setlocal
rem Check standard MASM32 paths first
if exist "D:\MASM32\masm32\bin\ml.exe" (
set "ML_EXE=D:\MASM32\masm32\bin\ml.exe"
set "LINK_EXE=D:\MASM32\masm32\bin\link.exe"
set "LIB_PATHS=/LIBPATH:D:\MASM32\masm32\lib"
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
goto do_build
)
if exist "C:\masm32\bin\ml.exe" (
set "ML_EXE=C:\masm32\bin\ml.exe"
set "LINK_EXE=C:\masm32\bin\link.exe"
set "LIB_PATHS=/LIBPATH:C:\masm32\lib"
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
goto do_build
)
if exist "F:\MASM32\masm32\bin\ml.exe" (
set "ML_EXE=F:\MASM32\masm32\bin\ml.exe"
set "LINK_EXE=F:\MASM32\masm32\bin\link.exe"
set "LIB_PATHS=/LIBPATH:F:\MASM32\masm32\lib"
set "EXTRA_FLAGS=/SUBSYSTEM:WINDOWS /RELEASE /VERSION:4.0"
goto do_build
)
rem Fallback to Visual Studio / MSVC BuildTools
set "MSVC_BIN=C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x86"
set "SDK_LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\um\x86"
set "UCRT_LIB=C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt\x86"
set "VC_LIB=C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.50.35717\lib\x86"
if exist "%MSVC_BIN%\ml.exe" (
set "ML_EXE=%MSVC_BIN%\ml.exe"
set "LINK_EXE=%MSVC_BIN%\link.exe"
set LIB_PATHS=/LIBPATH:"%SDK_LIB%" /LIBPATH:"%UCRT_LIB%" /LIBPATH:"%VC_LIB%"
set "EXTRA_FLAGS=/NOLOGO /SUBSYSTEM:WINDOWS"
goto do_build
)
echo [ERROR] No compatible MASM/MSVC assembler found!
goto err
:do_build
rem Prefer SDK imports for modern APIs missing from older MASM32 libraries.
if exist "%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.26100.0\um\x86\kernel32.lib" (
set LIB_PATHS=/LIBPATH:"%ProgramFiles(x86)%\Windows Kits\10\Lib\10.0.26100.0\um\x86" %LIB_PATHS%
)
set "ICON_RESOURCE="
if exist "build\casino_icon.res" set "ICON_RESOURCE=build\casino_icon.res"
echo Assembling poker.asm...
"%ML_EXE%" /c /coff /Cp /nologo /I. poker.asm
if errorlevel 1 goto err
echo Linking poker.obj...
"%LINK_EXE%" %EXTRA_FLAGS% %LIB_PATHS% /OUT:poker.exe poker.obj %ICON_RESOURCE% kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib
if errorlevel 1 goto err
copy /y poker.exe build\graphics\poker.exe >nul 2>&1
echo [SUCCESS] poker.exe built successfully!
goto end
:err
echo [ERROR] Build failed!
pause
exit /b 1
:end
endlocal