#!/bin/sh

# Check that theories/All.sh is up to date, as generated by theories/All.sh

ALL_CURRENT=theories/All.v
ALL_EXPECTED=theories/All.v.expected

theories/All.sh > ${ALL_EXPECTED}

if $(diff -q ${ALL_CURRENT} ${ALL_EXPECTED} > /dev/null) ; then
  echo "theories/All/v is up to date."
else
  echo "Error: theories/All.v needs update (please regenerate it with theories/All.sh):"
  diff -u ${ALL_CURRENT} ${ALL_EXPECTED}
  exit 1
fi

rm -f ${ALL_EXPECTED}
