2003-11-13 02:46:27 +08:00
|
|
|
#!/bin/sh
|
2004-02-26 22:15:10 +08:00
|
|
|
# compute dependencies for the PWscf directory tree
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2006-12-12 19:02:09 +08:00
|
|
|
# make sure there is no locale setting creating unneeded differences.
|
|
|
|
LC_ALL=C
|
|
|
|
export LC_ALL
|
|
|
|
|
2003-11-22 00:39:48 +08:00
|
|
|
# run from directory where this script is
|
|
|
|
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
|
2003-11-13 02:46:27 +08:00
|
|
|
TOPDIR=`pwd`
|
|
|
|
|
2006-10-20 05:17:24 +08:00
|
|
|
if test $# = 0
|
|
|
|
then
|
|
|
|
dirs=" Modules clib PW CPV flib pwtools upftools PP PWCOND \
|
2011-08-09 21:09:50 +08:00
|
|
|
Gamma PH D3 atomic VdW XSpectra//src \
|
|
|
|
GWW//gww GWW//pw4gww GWW//head ACFDT NEB Solvent"
|
2009-08-07 20:03:16 +08:00
|
|
|
|
2006-10-20 05:17:24 +08:00
|
|
|
else
|
|
|
|
dirs=$*
|
|
|
|
fi
|
|
|
|
|
2007-02-03 01:56:08 +08:00
|
|
|
for DIR_ in $dirs
|
2004-02-26 22:15:10 +08:00
|
|
|
do
|
2007-02-03 01:56:08 +08:00
|
|
|
DIR=`echo $DIR_ | sed 's?/??' `
|
2009-10-20 03:49:13 +08:00
|
|
|
# set inter-directory dependencies - only directories containing
|
|
|
|
# modules that are used, or files that are included, by routines
|
2009-11-07 01:28:19 +08:00
|
|
|
# in directory DIR should be listed in DEPENDS
|
2009-07-23 01:18:42 +08:00
|
|
|
DEPENDS="../include ../iotk/src"
|
2007-02-09 20:42:37 +08:00
|
|
|
case $DIR in
|
2011-04-28 19:46:36 +08:00
|
|
|
EE | flib | upftools | atomic | CPV | Solvent | PW )
|
2010-11-06 02:25:37 +08:00
|
|
|
DEPENDS="$DEPENDS ../Modules " ;;
|
2011-05-17 18:26:37 +08:00
|
|
|
PP | PWCOND | Gamma | PH | pwtools )
|
2010-10-23 00:36:36 +08:00
|
|
|
DEPENDS="$DEPENDS ../Modules ../PW" ;;
|
2010-09-10 03:23:57 +08:00
|
|
|
D3 | VdW | ACFDT )
|
2010-10-23 00:36:36 +08:00
|
|
|
DEPENDS="$DEPENDS ../Modules ../PW ../PH" ;;
|
2011-08-09 21:09:50 +08:00
|
|
|
XSpectra/src )
|
|
|
|
DEPENDS="../../iotk/src ../../include ../../Modules ../../PW" ;;
|
2009-08-07 20:03:16 +08:00
|
|
|
GWW/pw4gww )
|
2009-10-20 03:49:13 +08:00
|
|
|
DEPENDS="../../include ../../iotk/src ../../Modules \
|
2010-10-23 00:36:36 +08:00
|
|
|
../../PW " ;;
|
2009-08-07 20:03:16 +08:00
|
|
|
GWW/gww )
|
2009-10-20 03:49:13 +08:00
|
|
|
DEPENDS="../../include ../../iotk/src ../../Modules " ;;
|
2009-08-07 20:03:16 +08:00
|
|
|
GWW/head )
|
2009-10-20 03:49:13 +08:00
|
|
|
DEPENDS="../../include ../../iotk/src ../../Modules \
|
2010-10-23 00:36:36 +08:00
|
|
|
../../PW ../../PH ../pw4gww " ;;
|
2010-08-30 20:16:05 +08:00
|
|
|
NEB )
|
2010-10-23 00:36:36 +08:00
|
|
|
DEPENDS="$DEPENDS ../Modules ../PW" ;;
|
2010-08-30 20:16:05 +08:00
|
|
|
|
2004-02-26 22:15:10 +08:00
|
|
|
esac
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# generate dependencies file (only for directories that are present)
|
2009-09-11 21:28:47 +08:00
|
|
|
if test -d $TOPDIR/../$DIR
|
2004-02-26 22:15:10 +08:00
|
|
|
then
|
2009-09-11 21:28:47 +08:00
|
|
|
cd $TOPDIR/../$DIR
|
2009-08-07 20:03:16 +08:00
|
|
|
|
2004-11-09 18:53:55 +08:00
|
|
|
$TOPDIR/moduledep.sh $DEPENDS > make.depend
|
2005-03-18 19:11:04 +08:00
|
|
|
$TOPDIR/includedep.sh $DEPENDS >> make.depend
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# handle special cases
|
|
|
|
sed '/@\/cineca\/prod\/hpm\/include\/f_hpm.h@/d' \
|
|
|
|
make.depend > make.depend.tmp
|
|
|
|
sed '/@iso_c_binding@/d' make.depend.tmp > make.depend
|
2011-04-28 19:46:36 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
if test "$DIR" = "clib"
|
|
|
|
then
|
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed 's/@fftw.c@/fftw.c/' make.depend.tmp > make.depend
|
|
|
|
fi
|
2005-03-18 19:24:02 +08:00
|
|
|
|
2011-04-28 18:58:42 +08:00
|
|
|
if test "$DIR" = "PW"
|
|
|
|
then
|
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed '/@solvent_base@/d' make.depend.tmp > make.depend
|
|
|
|
fi
|
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
rm -f make.depend.tmp
|
2006-06-23 23:47:59 +08:00
|
|
|
|
2010-08-23 21:12:29 +08:00
|
|
|
# check for missing dependencies
|
|
|
|
if grep @ make.depend
|
|
|
|
then
|
|
|
|
notfound=1
|
|
|
|
echo WARNING: dependencies not found in directory $DIR
|
|
|
|
else
|
|
|
|
echo directory $DIR : ok
|
|
|
|
fi
|
2004-02-26 22:15:10 +08:00
|
|
|
fi
|
2003-11-13 02:46:27 +08:00
|
|
|
done
|
2005-03-18 19:30:21 +08:00
|
|
|
if test "$notfound" = ""
|
|
|
|
then
|
|
|
|
echo all dependencies updated successfully
|
|
|
|
fi
|