me.fier.engine/compile

26 lines
630 B
Plaintext
Raw Normal View History

2023-05-14 10:21:03 +00:00
#!/usr/bin/env bash
set -e
export target_os="${target_os:=$1}"
2023-08-10 17:47:28 +00:00
if [ "$target_os" = "" ]; then
2023-08-10 18:01:05 +00:00
echo "Usage: $0 <linux/openbsd>"
2023-08-10 17:47:28 +00:00
exit 1
fi
2023-08-10 17:47:28 +00:00
case "$target_os" in
linux)
2023-08-10 18:01:05 +00:00
echo "* Compiling: linux ..."
2023-08-10 17:47:28 +00:00
./lua_translate
gcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall
;;
openbsd)
2023-08-10 18:01:05 +00:00
echo "* Compiling: openbsd ..."
2023-08-10 17:47:28 +00:00
./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