#/usr/bin/bash

./makeheaders/makeheaders -h src/helpers/vars.hpp src/helpers/chunks.cpp src/helpers/debug.cpp src/helpers/entities.cpp src/helpers/input.cpp src/helpers/menu.cpp src/helpers/mesher.cpp src/helpers/networking.cpp src/helpers/utils.cpp src/helpers/inlines.hpp src/helpers/inventory.cpp src/helpers/locale.cpp src/helpers/recipes.cpp src/helpers/particles.cpp src/helpers/player.cpp src/helpers/multisound.cpp src/helpers/svlib.cpp -v > tmp.hpp
cat additions.hpp tmp.hpp > src/helpers/common.hpp
rm tmp.hpp

echo Building x86-64 Windows...
rm -rf build
cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w64.cmake -DWIN32=ON -DWIN32=true -B build
cd build
make -j12
cd ..
mkdir OUTPUT-w64
cp build/src/RCRAFT.exe OUTPUT-w64/CubeGame.exe
cp -r data/resources OUTPUT-w64
mkdir OUTPUT-w64/user
mkdir OUTPUT-w64/user/worlds