2023-05-14 10:21:03 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2023-08-11 12:28:10 +00:00
|
|
|
export target_os="${target_os:=$1}"
|
2023-08-10 17:47:28 +00:00
|
|
|
|
2023-08-11 12:28:10 +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-11 12:28:10 +00:00
|
|
|
|
2023-08-11 12:35:10 +00:00
|
|
|
if [ "$target_os" = "linux" ]; then
|
|
|
|
echo "* Compiling: linux ..."
|
|
|
|
./lua_translate
|
|
|
|
gcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$target_os" = "openbsd" ]; then
|
|
|
|
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
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "Unsupported platform. These platforms are currently available:\n* linux\n* openbsd\n"
|
|
|
|
exit 1
|