diff --git a/build.sh b/build.sh index 8dc04fc..8afadce 100755 --- a/build.sh +++ b/build.sh @@ -14,13 +14,16 @@ LDFLAGS='-lircclient -lsqlite3' mkdir -p $PREFIX && echo "Made directory: $PREFIX" -if [ ! -z ${DEBUG} ]; then CFLAG="$CFLAGS -Og -g3"; - else CPPFLAGS="$CPPFLAGS -DNDEBUG"; - CFLAG="$CFLAGS -O2 -flto=auto -fomit-frame-pointer -s"; fi +# Bourne shell is evil +if [ ${DEBUG} -eq 1 ] +then + CFLAGS=`echo "${CFLAGS} -Og -g3"` +else + CPPFLAGS="${CPPFLAGS} -DNDEBUG" + CFLAGS=`echo "${CFLAGS} -O2 -flto=auto -fomit-frame-pointer -s"` +fi -[ ! -z ${SAN} ] && CFLAG="$CFLAGS -fsanitize=$SAN" - -[ ! -e $DIR/include/config.h ] && cp $DIR/include/config.mk.h $DIR/include/config.h +[ ! -z ${SAN} ] && CFLAGS=`echo "$CFLAGS -fsanitize=$SAN"` echo "$CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS" $CC $CFLAGS -pipe $DIR/src/unity.c -o $PREFIX/$PROGN $CPPFLAGS $LDFLAGS