diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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 |