@echo off

REM Comprobar parámetro
IF "%1"=="" (
    echo Uso: build_windows.bat ^<PARAMETRO^>
    exit /b 1
)

set PARAM=%1

echo Compilando windows...
rmdir /S /Q build || exit /b 1
lagueirto windows || exit /b 1

echo Compilando windows_debug...
rmdir /S /Q build || exit /b 1
lagueirto windows_debug || exit /b 1

echo Creando paquetes...

copy bin\SDL3.dll .
copy bin\libwinpthread-1.dll .

REM Crear ZIP release con mini.exe + DLLs
tar -a -c -f mini_%PARAM%_win32-x64_release.zip mini.exe *.dll || exit /b 1

REM Crear ZIP debug solo con mini_debug.exe
tar -a -c -f mini_%PARAM%_win32-x64_debug.zip mini_debug.exe *.dll || exit /b 1

del SDL3.dll
del libwinpthread-1.dll

echo Paquetes generados:
echo   mini_%PARAM%_win32-x64_release.zip
echo   mini_%PARAM%_win32-x64_debug.zip
