3 readonly CLANG
="clang -DNDEBUG -ferror-limit=1 -flto \
4 -fvisibility=hidden -march=native -O3 -s -static -std=c11 -Werror \
5 -Weverything -Wno-disabled-macro-expansion -Wno-reserved-id-macro"
10 readonly SED_SCRIPT
='s_[ \t]*#include[ \t]*"\(.*\)".*_src/\1_p'
13 [ ! -f "$1" ] ||
[ -z "$(find "$1" -newer "$2")" ]
17 for SOURCE
in src
/*.c
; do
19 OBJECT
="bin${OBJECT#src}"
21 for DEP
in "$SOURCE" $
(sed -n "$SED_SCRIPT" "$SOURCE"); do
22 if is_not_newer_than
"$OBJECT" "$DEP"; then
25 $CLANG -o "$OBJECT" "$SOURCE" &
27 "$@" -o "$OBJECT" "$SOURCE" &
33 for JOB
in $
(jobs -p); do
34 wait "$JOB" ||
exit $?