Compile C with some optimizations
[llpp.git] / doocaml.sh
blobe7c080da173941568bfc52fd99b3156cf3373b88
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 test "x" = "x$pp" || {
12 ef=$(mktemp)
13 trap 'test -n "$ef" && rm -f "$ef"' 0
14 (cd >/dev/null $outdir && $compiler -pp "$pp" $incs 2>$ef "$@" -o $out $in)
15 rc=$?
16 if test "$rc" != 0; then
17 sed 1>&2 "s;File \"\([^\"]*\)\"\(.*\)$;File $in\2;" $ef
19 exit $rc
20 } && {
21 cd >/dev/null $outdir && $compiler "$@" $incs -o $out $in