working reworked game
This commit is contained in:
31
compile.sh
31
compile.sh
@@ -1,7 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
arg=-1
|
||||
|
||||
if [ -v 1 ]; then
|
||||
arg=$1
|
||||
fi
|
||||
|
||||
if [ $arg = "clean" ]; then
|
||||
rm -rf ./target/*
|
||||
exit
|
||||
fi
|
||||
|
||||
oflag="-Og"
|
||||
debug_flag="-ggdb"
|
||||
|
||||
if [ $arg = "release" ]; then
|
||||
oflag="-O3"
|
||||
debug_flag=""
|
||||
fi
|
||||
|
||||
src="src/*.c"
|
||||
flags="-std=c23 -ggdb -Og -Wall -Wextra -Werror -Wpedantic -pedantic-errors"
|
||||
flags="-std=c23 $oflag $debug_flag -Wall -Wextra -Werror -Wpedantic -pedantic-errors"
|
||||
includes="-I src/headers"
|
||||
|
||||
cmd="gcc $flags $includes $src -o target/sanke"
|
||||
@@ -9,14 +28,12 @@ cmd="gcc $flags $includes $src -o target/sanke"
|
||||
echo $cmd
|
||||
$cmd
|
||||
|
||||
|
||||
if [ $? -gt 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
echo
|
||||
|
||||
if [ -v 1 ]; then
|
||||
if [ $1 = "run" ]; then
|
||||
./target/sanke
|
||||
fi
|
||||
if [ $arg = "run" ]; then
|
||||
echo
|
||||
./target/sanke
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user