From a68cc52b5c5d1c104de8d675b90816aaa39f4ace Mon Sep 17 00:00:00 2001 From: kartofen Date: Tue, 9 Aug 2022 00:35:47 +0300 Subject: nearly works --- build.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'build.sh') 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 -- cgit v1.2.3