From 28f6aba84e9684d9266cd3bff1f82583ac6213fd Mon Sep 17 00:00:00 2001 From: Herby Gillot Date: Sat, 9 May 2020 14:16:41 -0400 Subject: [PATCH] Tweak build.sh: - support environmentally-declared CFLAGS and LDFLAGS - indicate build failure with an error exit code --- build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 38c0e068..b88c6d19 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash -cflags="-Wall -O3 -g -std=gnu11 -Isrc -DLUA_USE_POPEN" -lflags="-lSDL2 -lm" +cflags="${CFLAGS} -Wall -O3 -g -std=gnu11 -Isrc -DLUA_USE_POPEN" +lflags="${LDFLAGS} -lSDL2 -lm" if [[ $* == *windows* ]]; then platform="windows" @@ -40,3 +40,7 @@ echo "cleaning up..." rm *.o rm res.res 2>/dev/null echo "done" + +if [[ $got_error ]]; then + exit 1 +fi