All pastes #234315 Raw Edit

Someone

public text v1 · immutable
·published 2006-11-02 12:59 UTC
rendered paste body
#!/bin/sh
SUBDIRS="
1.basicmath_automotive
2.jpeg_consumer/jpeg-6a
3.sha_security
4.ghostscript_office/src
5.adpcm_telecomm/src
"
BINS="
  1.basicmath_automotive/basicmath_large
  2.jpeg_consumer/jpeg-6a/cjpeg
  2.jpeg_consumer/jpeg-6a/djpeg
  3.sha_security/sha
  4.ghostscript_office/src/gs
  5.adpcm_telecomm/bin/rawcaudio
  5.adpcm_telecomm/bin/rawdaudio
"
TOPDIR=`pwd`
OPTS="-O0 -O1 -O2 -O3 -Os"
REGISTEROPTS="16 9 8"

for opt in $OPTS; do
  for regs in $REGISTEROPTS; do
    if [ $regs = 16 ]; then
      REGSUFFIX="-r16"
      REGOPT=""
    elif [ $regs = 9 ]; then
      REGSUFFIX="-r9"
      REGOPT="REGISTER_9=yes"
    else
      REGSUFFIX="-r8"
      REGOPT="REGISTER_8=yes"
    fi

    for subdir in $SUBDIRS; do
      LOGTMP=/tmp/snilog.$$.$regs.$opt.`echo $subdir|sed -e 's,/,_,g'`

      echo "==> Building in $subdir with option $opt with $regs registers"
      cd $TOPDIR/$subdir
      make clean >$LOGTMP 2>&1 || (echo "OOPS! see log $LOGTMP" && exit 1)
      env OPT=$opt $REGOPT make >$LOGTMP 2>&1 || (echo "OOPS! see log: $LOGTMP" && exit 1)
      rm -f $LOGTMP
    done

    cd $TOPDIR
    for bin in $BINS; do
      cp $bin $bin$opt$REGSUFFIX
    done
  done
done