#/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 Linux...
rm -rf build
cmake -B build -DUNIX=ON -DUNIX=true
cd build
make -j12
cd ..
mkdir OUTPUT-Linux
cp build/src/RCRAFT OUTPUT-Linux/CubeGame
cp -r data/resources OUTPUT-Linux
mkdir OUTPUT-Linux/user
mkdir OUTPUT-Linux/user/worlds