#!/bin/sh
#
# Copyright (c) 2006-2007 The ABINIT Group (Yann Pouillon)
# All rights reserved.
#
# This file is part of the ABINIT software package. For license information,
# please see the COPYING file in the top-level directory of the ABINIT source
# distribution.
#

# Check that we are in the right directory
if test ! -s "./configure.ac" -o ! -s "src/main/abinit.F90"; then
	echo "makemake: This is not an ABINIT source tree - aborting now"
	exit 1
fi

start_time=`date '+%s'`

cat <<EOF
MakeETSF report
===============

EOF

# Re-generate source files
echo "BEGIN"
echo -n " * Cleaning-up source files..."
rm -f lib/etsf_io/*.F90
echo "done."
echo -n " * Generating ETSF module..."
./config/scripts/etsf-make-module
echo "done."
echo -n " * Generating ETSF subprograms..."
./config/scripts/etsf-make-subprograms
echo "done."
echo -n " * Generating ETSF files for ABINIT..."
./config/scripts/etsf-make-abinit-files
echo "done."
echo -n " * Regenerating makefiles..."
./config/scripts/make-makefiles-libraries
echo "done."
echo "END"
echo ""

end_time=`date '+%s'`

cat <<EOF
-- 
Time elapsed : `awk "END{print ${end_time}-${start_time}}" < /dev/null` s

EOF
