aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 47fdc04..b3dfc9f 100755
--- a/build.sh
+++ b/build.sh
@@ -10,8 +10,15 @@ if [ -z "$CC" ]; then
CC=cc
fi
-CFLAGS="-Wall -Wextra -Werror -g -O0 -DDEBUG -std=c89 -pedantic -fsanitize=address -D_GNU_SOURCE"
-LIBS="-pthread -lasan"
+CFLAGS=""
+LIBS=""
+if [ ! -z "$SANITIZE_ADDRESS" ]; then
+ CFLAGS+="-fsanitize=address "
+ LIBS+="-lasan "
+fi
+
+CFLAGS+="-Wall -Wextra -Werror -g -O0 -DDEBUG -std=c89 -pedantic -D_GNU_SOURCE"
+LIBS+="-pthread"
set -x
time "$CC" $source_files $CFLAGS $LIBS -o amalgam