aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/build.sh b/build.sh
index 9d242c3..84a12e8 100755
--- a/build.sh
+++ b/build.sh
@@ -1,22 +1,28 @@
#!/bin/sh
+
cd ${0%/*} # go to project root
set -xe
-FLAGS="-Wall -Wextra -g"
+FLAGS="-Wall -Wextra -g -pedantic"
SRCD="src"
ODIR="obj"
BIN="bin"
+VALGRND=""
+
+function leak {
+ VALGRND="valgrind --leak-check=full"
+}
function clean {
rm -rf $BIN
rm -rf $ODIR
rm -rf files
+ kill $( ps -q $$ -o pgid= )
}
if ! { [[ $# -eq 0 ]]; } 2> /dev/null
then
- ($1)
- exit 0;
+ $1
fi
mkdir -p $ODIR
@@ -31,5 +37,5 @@ gcc -o $BIN/wfc $ODIR/main.o $ODIR/ppm.o $ODIR/tiles.o $FLAGS
gcc -o $BIN/gen_tiles $ODIR/gen_tiles.o $ODIR/ppm.o $FLAGS
-$BIN/gen_tiles
-$BIN/wfc
+$VALGRND $BIN/gen_tiles
+$VALGRND $BIN/wfc