M build_util.sh => build_util.sh +10 -10
@@ 116,11 116,11 @@ typecheck()
# Caution: overwrite the traps for terminating signals
atexit()
{
- if [ "${_atexit_scripts:-}" ]
- then
- _atexit_scripts="$_atexit_scripts; $1"
- else
- _atexit_scripts=$1
+ if [ "${_atexit_scripts:-}" ]
+ then
+ _atexit_scripts="$_atexit_scripts; $1"
+ else
+ _atexit_scripts=$1
trap 'exit 1' HUP INT QUIT ABRT ALRM TERM
trap 'eval "$_atexit_scripts"' EXIT
fi
@@ 256,7 256,7 @@ sed_repl_escape()
# Escape all globbing metacharacters in $1
glob_escape()
{
- pecho "$1" | sed 's#[[*?]#\\&#g'
+ pecho "$1" | sed 's#[[*?]#\\&#g'
}
# List the absolute path of all files in $1 separated by \n. The remaining
@@ 400,7 400,7 @@ pselect()
printf '%s: invalid value\n' "$choice" >&2
continue
fi
- pecho "$in" | sed -n "$choice"'{p; q}'
+ pecho "$in" | sed -n "$choice"'{p; q}'
break
done
}
@@ 439,7 439,7 @@ pseq()
{
local incr=1 first=1
case $# in
- 1) last=$1;;
+ 1) last=$1;;
2)
first=$1
last=$2
@@ 908,8 908,8 @@ pb_make()
fi
{ cat <<'EOF'; $append_stdin && cat; } | \
"${MAKE:-make}" $([ "${JOBS:-}" -ne 1 ] && pecho -j$JOBS) -f - \
- OBJ="$(src2obj)" CC="$CC" BIN="$BIN" CFLAGS="${CFLAGS:-}" CPPFLAGS="${CPPFLAGS:-}" \
- LDFLAGS="${LDFLAGS:-}" LDLIBS="${LDLIBS:-}" "$@"
+ SRC="$SRC" OBJ="$(src2obj)" CC="$CC" BIN="$BIN" CFLAGS="${CFLAGS:-}" \
+ CPPFLAGS="${CPPFLAGS:-}" LDFLAGS="${LDFLAGS:-}" LDLIBS="${LDLIBS:-}" "$@"
.POSIX:
.SUFFIXES:
.SUFFIXES: .c .o .gperf .lex
M prog-c/build.sh => prog-c/build.sh +3 -3
@@ 19,9 19,6 @@ NATIVE=${NATIVE:-false}
CONFIG=${CONFIG:-release}
PREFIX=$(preadlinkf "${DESTDIR+${DESTDIR%/}}${PREFIX:-/usr/local}")
-typecheck bool LTO PGO STATIC NATIVE
-typecheck uint JOBS
-
# Target specific values
STD=c99
BIN=prog-c
@@ 33,6 30,9 @@ LDLIBS='-pthread -lm'
USE_FEATURE1=${USE_FEATURE1:-true}
USE_FEATURE2=${USE_FEATURE2:-false}
+typecheck bool LTO PGO STATIC NATIVE USE_FEATURE1 USE_FEATURE2
+typecheck uint JOBS
+
# Prepare the source list (must be done before any cclean call)
SRC=$(printf '%s\n' *.c)