25 lines
618 B
Bash
Executable File
25 lines
618 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
export target_os="${target_os:=$1}"
|
|
|
|
if [ "$target_os" = "" ]; then
|
|
echo "Usage: $0 <linux/openbsd>"
|
|
exit 1
|
|
fi
|
|
|
|
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 |