march.sh 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. : '$Header$'
  2. case $# in
  3. 3) makecmd=$3 ;;
  4. 2) makecmd=compmodule ;;
  5. *) echo "Usage: $0 srcdir archname [ makecmd ]"; exit 1 ;;
  6. esac
  7. errors=no
  8. if test -r $1/LIST
  9. then
  10. <$1/LIST (
  11. read archname
  12. if test -r $1/$archname
  13. then
  14. arch x $1/$archname
  15. for file in `arch t $1/$archname`
  16. do
  17. suffix=`expr $file : '.*\(\..*\)'`
  18. ofile=`$makecmd $file $suffix`
  19. if test $? != 0
  20. then errors=yes
  21. fi
  22. rm $file
  23. OFILES="$OFILES $ofile"
  24. done
  25. else
  26. while read file
  27. do
  28. suffix=`expr $file : '.*\(\..*\)'`
  29. ofile=`$makecmd $1/$file $suffix`
  30. if test $? != 0
  31. then errors=yes
  32. fi
  33. OFILES="$OFILES $ofile"
  34. done
  35. fi
  36. if test $errors = no
  37. then
  38. ${ASAR-arch} cr $2 $OFILES
  39. ${RANLIB-:} $2
  40. rm $OFILES
  41. else
  42. echo $2 not made, due to compilation errors
  43. exit 1
  44. fi
  45. )
  46. else
  47. echo no LIST file in directory $1
  48. exit 1
  49. fi