ack/util/shf/march.sh

56 lines
960 B
Bash
Raw Normal View History

#!/bin/sh
1994-06-24 11:31:16 +00:00
: '$Id$'
1984-07-19 11:50:18 +00:00
case $# in
3) makecmd=$3 ;;
2) makecmd=compmodule ;;
1984-07-19 11:50:18 +00:00
*) echo "Usage: $0 srcdir archname [ makecmd ]"; exit 1 ;;
esac
errors=no
if test -r $1/LIST
then
(
1984-07-19 11:50:18 +00:00
read archname
if test -r $1/$archname
then
arch x $1/$archname
for file in `arch t $1/$archname`
do
echo $file: 1>&2
1984-07-19 11:50:18 +00:00
suffix=`expr $file : '.*\(\..*\)'`
ofile=`$makecmd $file $suffix`
if test $? != 0
then errors=yes
fi
rm $file
OFILES="$OFILES $ofile"
done
else
while read file
do
1991-09-18 18:39:11 +00:00
echo $file: 1>&2
1984-07-19 11:50:18 +00:00
suffix=`expr $file : '.*\(\..*\)'`
ofile=`$makecmd $1/$file $suffix`
if test $? != 0
then errors=yes
fi
OFILES="$OFILES $ofile"
done
fi
if test $errors = no
then
1991-09-18 18:39:11 +00:00
if ${ASAR-arch} cr $2 $OFILES && ${RANLIB-:} $2
then
rm $OFILES
fi
1984-07-19 11:50:18 +00:00
else
echo $2 not made, due to compilation errors
exit 1
fi
) < $1/LIST
1984-07-19 11:50:18 +00:00
else
echo no LIST file in directory $1
exit 1
fi