if [ $# != 2 ]; then
  echo "You typed: $0 $*"
  echo "Usage: $0 m k"
  echo "Where t^m + t^k + 1 is the trinomial to be tested."
  echo "The degree m should be odd an less than 1200."
  echo "The exponent k must be larger than 0 and less than or equal to (m+1)/2."
  exit 1
fi
echo "int const m = $1, k = $2;" > input.hcc
echo "char const* factor_strings[] = {" >> input.hcc
if ! test -x factorization; then
  make factorization || exit
fi
factorization $1 | sed -e 's/^/  "/' -e 's/$/",/' >> input.hcc
echo "};" >> input.hcc
rm -f irreducible irreducible.o
make irreducible >/dev/null
./irreducible
