logo

utils

~/.local/bin tools and git-hooks
commit: c18982151fa006083e9cccd0540fa4473afde264
parent: 8974287524573c31bb1f97b750911510a565c283
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 23 Aug 2017 23:46:05 +0200

make.sh: Fix problems found by ShellCheck

Diffstat:

Mmake.sh12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/make.sh b/make.sh @@ -2,7 +2,7 @@ # Copyright CC-BY-SA-4.0 2017- Haelwenn (lanodan) Monnier <contact@hacktivis.me> CC=${CC:-cc} -CFLAGS=${CFLAGS:--Wall} +CFLAGS=${CFLAGS:--Wall -Wextra -O2} PREFIX=${PREFIX:-/usr/local} BINDIR=${BINDIR:-${PREFIX}/bin} #LIBDIR=${LIBDIR:-${PREFIX}/lib} @@ -14,15 +14,15 @@ install uses PREFIX, LIBDIR, BINDIR, DOCDIR, environment variables" } all() { - for i in $(ls src | grep '\.c$'); do - ${CC} ${CFLAGS} -o bin/${i%.c} src/${i} + for i in src/*.c; do + "${CC}" "${CFLAGS}" -o "bin/${i%.c}" "src/${i}" done } install() { - mkdir -p ${BINDIR} && cp bin/* ${BINDIR}; - mkdir -p ${DOCDIR} && cp doc/* ${DOCDIR}; - #mkdir -p ${LIBDIR} && cp lib/* ${LIBDIR}; + mkdir -p "${BINDIR}" && cp bin/* "${BINDIR}"; + mkdir -p "${DOCDIR}" && cp doc/* "${DOCDIR}"; + #mkdir -p "${LIBDIR}" && cp lib/* "${LIBDIR}"; } clean() {