check.sh 1.33 KB
Newer Older
1 2 3 4 5 6
#!/bin/bash

subdir=".curry"
compilers="cymake cymake_pakcs"
modules="*.curry"
targets="flat xml acy uacy"
Björn Peemöller 's avatar
Björn Peemöller committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
importdir="."

function usage()
{
  echo "Usage: check.sh [OPTIONS] modules"
  echo "Compare old and new frontend against each other"
  echo ""
  echo "  -i DIR  , --import-dir DIR   Search for libraries in DIR"
  echo "  -i EXTS , --targets EXTS     Create the target types EXTS (some of flat, xml, acy, uacy)"
  echo "  -h      , --help             Show this help and exit"
}

while [ "$1" != "" ]; do
  case $1 in
    -i | --import-dir  )    shift
                            importdir=$1
                            ;;
    -t | --targets     )    shift
                            targets=$1
                            ;;
    -h | --help )           usage
                            exit
                            ;;
    * )                     modules=$*
                            break
  esac
  shift
done
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

for comp in $compilers; do
  echo -e "$comp\n============"

  # clean up before using the compiler
  rm -f  $comp/*
  rm -rf $subdir
  if [ ! -d $comp ]; then
    mkdir $comp
  fi
  ln -s  $comp/  $subdir

  # compile targets
  for mdl in $modules; do
    for tgt in $targets; do
Björn Peemöller 's avatar
Björn Peemöller committed
50
      $comp -e -i $importdir --$tgt $mdl
51 52 53 54 55 56 57 58 59 60 61
    done
  done
done

rm -rf $subdir

# show differences
echo "Differences"
echo "==========="
diff -brq $compilers