#!/bin/bash

DOC=$PWD

cd ..
svn info --xml | grep revision | head -n 1 > revinfo.xml
sed -i "s/>//g" revinfo.xml
. revinfo.xml
REV="r$revision"
rm revinfo.xml

cd $DOC
DOXYFILE="Doxyfile.$REV"
EXCL="src\/dimensions.f90 src\/geometry.f90 src\/trace.f90 src\/mpipara.f90"

sed "s/rXXX/$REV/g" Doxyfile > $DOXYFILE
sed -i "s/EXCLUDED_F90/$EXCL/g" $DOXYFILE

rm -rf src html latex
mkdir src
cp ../src/*.f90 ../ppsrc/src/*.f90 src
doxygen $DOXYFILE
rm $DOXYFILE

set -x
time lftp dubos@ftp.lmd.polytechnique.fr -e "mirror -R html perso/DYNAMICO/$REV ; exit"
