me.fier.engine/run
2023-08-10 20:01:05 +02:00

28 lines
651 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ "$#" -ne "1" ]; then
echo "Usage: $0 <linux/openbsd>"
exit 1
fi
export target_os="$1"
case "$target_os" in
linux)
echo "* Compiling: linux ..."
./lua_translate
gcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall
;;
openbsd)
echo "* Compiling: openbsd ..."
./lua_translate
egcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall -I /usr/local/include
;;
*)
echo "Unsupported OS, only linux and openbsd work"
exit 1
;;
esac
echo "Running engine ..."
exec ./engine