added run but better
This commit is contained in:
parent
fcdc55f3b2
commit
1b9e028e75
28
run
Executable file → Normal file
28
run
Executable file → Normal file
@ -1,5 +1,33 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <supported_os>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
target_os=$(echo "$1")
|
||||||
|
|
||||||
|
printf "$target_os\n"
|
||||||
|
|
||||||
|
case "$target_os" in
|
||||||
|
linux)
|
||||||
|
echo "compiling linux"
|
||||||
./lua_translate
|
./lua_translate
|
||||||
gcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall
|
gcc -std=gnu89 src/main.c -g -lSDL2 -llua5.3 -lm -o engine -O3 -Werror -Wall
|
||||||
|
;;
|
||||||
|
openbsd)
|
||||||
|
echo "compiling openbsd"
|
||||||
|
sed -i 's/lua5\.3/lua-5.3/g' lua_translate
|
||||||
|
./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
|
||||||
|
|
||||||
|
printf "\n\tengine is running"
|
||||||
|
|
||||||
exec ./engine
|
exec ./engine
|
||||||
|
Loading…
Reference in New Issue
Block a user