#!/bin/sh

MAX_TIARITY=@MAX_TIARITY@
for file in @TOP_SRCDIR@/tlib/ti/domains/domain-source/ti*.h ; do
  base=`basename $file N.h`
  arity=0
  while test $arity != `expr $MAX_TIARITY` ; do
     aritym1=$arity
     arity=`expr $arity + 1`
     OUTBASE=@TOP_SRCDIR@/tlib/ti/domains/${base}${arity}
     OUTFILE=${OUTBASE}.ti
     rm -f ${OUTBASE}.ti ${OUTBASE}.java
     echo "Creating ${OUTFILE} ..."
   ( echo "/* AUTOGENERATED FILE - DO NOT EDIT */" ; \
     echo "#define ARITY   $arity"   ; \
     echo "#define ARITYM1 $aritym1" ; \
     echo "#include \"$file\""       ) > $OUTFILE
  done
done
