@echo off
REM Build the 32-bit Horse (for 32-bit Windows XP/Vista and up).
REM Needs the i686 toolchain:  pacman -S --needed mingw-w64-i686-gcc
set BIN=C:\msys64\mingw32\bin
REM windres calls its sibling gcc to preprocess, so put the toolchain on PATH.
set PATH=%BIN%;%PATH%
"%BIN%\windres.exe" horse.rc -O coff -o horse_res32.o
if not %errorlevel%==0 (echo Resource build FAILED & goto :eof)
"%BIN%\g++.exe" -O2 -mwindows -static -static-libgcc -static-libstdc++ horse.cpp horse_res32.o -o horse_x86.exe -lwinmm -lgdi32 -lshell32
if %errorlevel%==0 (echo Built horse_x86.exe ^(32-bit^)) else (echo Build FAILED)
