#!/bin/sh
#
# Copyright (C) 2005 Anders Logg.                                                                                                                     
# Licensed under the GNU GPL Version 2.       
#
# Recompile all ffc forms (use when FFC has been updated)
# This script should be run from the top level directory.
                                                                                                    
# Simple test to see where we are
# FIXME: Does not work when typing ./scripts/...
CHECK=`echo $0 | cut -d'/' -f1`
if [ "$CHECK" != "scripts" ]; then
        echo "This script must be run from the top level directory."
        exit 1
fi

TOPLEVEL=`pwd`

DIRS='src/modules/poisson/dolfin
      src/modules/convdiff/dolfin
      src/modules/elasticity/dolfin
      src/modules/elasticity-updated/dolfin
      src/kernel/fem/dolfin
      src/demo/poisson
      src/demo/fem/convergence'

for DIR in $DIRS; do
    cd $TOPLEVEL/$DIR
    for f in *.form; do
	echo $DIR
	ffc $f
    done
done
