Tweak build.sh:

- support environmentally-declared CFLAGS and LDFLAGS
- indicate build failure with an error exit code
This commit is contained in:
Herby Gillot 2020-05-09 14:16:41 -04:00
parent 143f8867a1
commit 28f6aba84e
1 changed files with 6 additions and 2 deletions

View File

@ -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