3 # run .../target/os/tst/foo.s [ remotehost ]
6 target
=`echo $1 | awk -F/ '{ print $(NF-3) }'`
7 os
=`echo $1 | awk -F/ '{ print $(NF-2) }'`
11 *symbolic
/irix
*) idir
=include
/mips
/irix
; remotehost
=noexecute
;;
12 *symbolic
/osf
*) idir
=include
/alpha
/osf
; remotehost
=noexecute
;;
13 *) idir
=include
/$dir; remotehost
=${2-$REMOTEHOST} ;;
16 if [ ! -d "$target/$os" -o ! -d "$idir" ]; then
17 echo 2>&1 $0: unknown combination
'"'$target/$os'"'
22 BUILDDIR
=${BUILDDIR-.} LCC="${LCC-${BUILDDIR}/lcc} -Wo-lccdir=$BUILDDIR"
23 TSTDIR=${TSTDIR-${BUILDDIR}/$dir/tst}
24 if [ ! -d $TSTDIR ]; then mkdir -p $TSTDIR; fi
26 echo ${BUILDDIR}/rcc$EXE -target=$target/$os $1: 1>&2
27 $LCC -S -I$idir -Ualpha -Usun -Uvax -Umips -Ux86 \
28 -Wf-errout=$TSTDIR/$C.2 -D$target -Wf-g0 \
29 -Wf-target=$target/$os -o $1 tst/$C.c
30 if [ $? != 0 ]; then remotehost=noexecute; fi
31 if [ -r $dir/tst/$C.2bk ]; then
32 diff $dir/tst/$C.2bk $TSTDIR/$C.2
34 if [ -r $dir/tst/$C.sbk ]; then
35 if diff $dir/tst/$C.sbk $TSTDIR/$C.s; then exit 0; fi
40 ""|"-") $LCC -o $TSTDIR/$C$EXE $1; $TSTDIR/$C$EXE <tst/$C.0 >$TSTDIR/$C.1 ;;
41 *) rcp $1 $remotehost:
42 if expr "$remotehost" : '.*@' >/dev/null ; then
43 remotehost="`expr $remotehost : '.*@\(.*\)'` -l `expr $remotehost : '\(.*\)@'`"
45 rsh $remotehost "cc
-o $C$EXE $C.s
-lm;.
/$C$EXE;rm -f $C$EXE $C.
[so
]" <tst/$C.0 >$TSTDIR/$C.1
48 if [ -r $dir/tst/$C.1bk ]; then
49 diff $dir/tst/$C.1bk $TSTDIR/$C.1