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
|
|
|
|
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`
|
|
|
|
|
2005-03-18 19:24:02 +08:00
|
|
|
for DIR in Modules clib PW CPV flib pwtools upftools PP PWCOND \
|
2006-04-03 18:33:22 +08:00
|
|
|
Gamma PH D3 atomic Nmr VIB VdW
|
2004-02-26 22:15:10 +08:00
|
|
|
do
|
|
|
|
# set inter-directory dependencies
|
|
|
|
case $DIR in
|
2005-10-20 23:12:05 +08:00
|
|
|
Modules | clib )
|
2006-01-25 12:18:46 +08:00
|
|
|
DEPENDS="../include ../flib ../iotk/src" ;;
|
2004-11-25 23:43:24 +08:00
|
|
|
PW | CPV | flib | pwtools | upftools | atomic )
|
2006-01-25 12:18:46 +08:00
|
|
|
DEPENDS="../include ../flib ../Modules ../iotk/src" ;;
|
2005-03-18 19:11:04 +08:00
|
|
|
PP | PWCOND | Gamma | PH )
|
2006-01-25 12:18:46 +08:00
|
|
|
DEPENDS="../include ../flib ../Modules ../PW ../iotk/src" ;;
|
2006-04-03 18:33:22 +08:00
|
|
|
D3 | Nmr | VdW )
|
|
|
|
DEPENDS="../include ../flib ../Modules ../PW ../PH ../iotk/src" ;;
|
2006-01-25 12:18:46 +08:00
|
|
|
VIB ) DEPENDS="../include ../flib ../Modules ../PW ../iotk/src ../CPV";;
|
2004-02-26 22:15:10 +08:00
|
|
|
esac
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2004-02-26 22:15:10 +08:00
|
|
|
# generate dependencies file
|
|
|
|
if test -d $TOPDIR/$DIR
|
|
|
|
then
|
|
|
|
cd $TOPDIR/$DIR
|
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
|
2004-02-26 22:15:10 +08:00
|
|
|
fi
|
2003-11-13 02:46:27 +08:00
|
|
|
|
2005-03-18 19:24:02 +08:00
|
|
|
# handle special cases
|
2005-03-18 19:11:04 +08:00
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed '/@\/cineca\/prod\/hpm\/include\/f_hpm.h@/d' \
|
|
|
|
make.depend.tmp > make.depend
|
2005-03-18 19:24:02 +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
|
2006-06-23 23:47:59 +08:00
|
|
|
|
|
|
|
if test "$DIR" = "Modules"
|
|
|
|
then
|
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed 's/fft_scalar.o : @mkl_dfti.f90@//' make.depend.tmp > make.depend
|
|
|
|
mv make.depend make.depend.tmp
|
|
|
|
sed 's/fft_scalar.o : @mkl_dft_type@//' make.depend.tmp > make.depend
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 19:11:04 +08:00
|
|
|
rm -f make.depend.tmp
|
|
|
|
|
2004-02-26 22:15:10 +08:00
|
|
|
# check for missing dependencies
|
2004-11-09 18:53:55 +08:00
|
|
|
if grep @ make.depend
|
2004-02-26 22:15:10 +08:00
|
|
|
then
|
2005-03-18 19:30:21 +08:00
|
|
|
notfound=1
|
2005-03-18 19:11:04 +08:00
|
|
|
echo WARNING: dependencies not found in directory $DIR
|
2005-03-18 19:30:21 +08:00
|
|
|
else
|
|
|
|
echo directory $DIR : ok
|
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
|