remove dolog definition to fix a warning
[llpp.git] / doocaml
blobc790d9205accd9448c17030a63dc0ddc56849f03
1 #!/bin/sh
2 set -e
4 compiler="$1"
5 out="$2"
6 in="$3"
7 outdir="$(dirname "$out")"
8 srcdir="$(pwd -P)"
9 shift 3
11 dodep ()
13 (cd >/dev/null $srcdir && ocamldep $(basename $in)) | \
14 (sed >$objdir/$out.d \
15 -e "/.cmx/d" \
16 -e 's;\([[:alnum:]\.]\+\);'$outdir'/\1;g' \
17 -e '/:$/d')
20 expr >/dev/null "$*" : '.* -pp ' && {
21 ef=$(mktemp)
22 trap 'test -n "$ef" && rm -f "$ef"' 0
23 (cd >/dev/null $outdir && $compiler 2>$ef "$@" -o $out $in)
24 rc=$?
25 if test "$rc" != 0; then
26 sed 1>&2 "s;File \"\([^\"]*\)\"\(.*\)$;File $in\2;" $ef
27 else
28 dodep
30 exit $rc
31 } || {
32 (cd >/dev/null $outdir && $compiler "$@" -o $out $in) && dodep