wmii/util/compile

25 lines
743 B
Plaintext
Raw Normal View History

#!/bin/sh -f
outfile="$1"; shift
bin="$(echo $0 | sed 's,/[^/]*$,,')"
# Derived from Russ Cox's 9c in plan9port.
xtmp=/tmp/cc.$$.$USER.out
echo CC $($bin/cleanname ${BASE}$outfile)
$CC -o $outfile $CFLAGS $@ 2>$xtmp
status=$?
2007-07-02 01:43:27 +04:00
base=$(echo $BASE | sed 's/,/\\,/g')
2007-07-01 23:26:14 +04:00
re='\([^[:space:]/]*\..:[0-9]\)'
2007-07-02 01:43:27 +04:00
cat $xtmp | sed "s,^$re,$base&,g; s,\([[:space:]]\)$re,\1$base\2,g" |
egrep -v ': error: .Each undeclared identifier|: error: for each function it appears|is dangerous, better use|is almost always misused|: In function |: At top level:|support .long long.|use of C99 long long|ISO C forbids conversion' |
sed 's/ .first use in this function.$//; s/\"\([^\"][^\"]*\)\", line \([0-9][0-9]*\)/\1:\2/g' |
uniq 1>&2
rm -f $xtmp
exit $status