2013-05-31 00:29:38 +08:00
|
|
|
# Install/unInstall package files in LAMMPS
|
|
|
|
# mode = 0/1/2 for uninstall/install/update
|
2013-05-31 01:10:03 +08:00
|
|
|
|
2013-05-31 00:29:38 +08:00
|
|
|
# this is default Install.sh for all packages
|
2013-05-31 01:10:03 +08:00
|
|
|
# if package has an auxiliary library or a file with a dependency,
|
2013-05-31 00:29:38 +08:00
|
|
|
# then package dir has its own customized Install.sh
|
|
|
|
|
|
|
|
mode=$1
|
|
|
|
|
|
|
|
# arg1 = file, arg2 = file it depends on
|
|
|
|
|
|
|
|
action () {
|
|
|
|
if (test $mode = 0) then
|
|
|
|
rm -f ../$1
|
|
|
|
elif (! cmp -s $1 ../$1) then
|
|
|
|
if (test -z "$2" || test -e ../$2) then
|
|
|
|
cp $1 ..
|
|
|
|
if (test $mode = 2) then
|
|
|
|
echo " updating src/$1"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif (test ! -z "$2") then
|
|
|
|
if (test ! -e ../$2) then
|
|
|
|
rm -f ../$1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# all package files with no dependencies
|
|
|
|
|
|
|
|
for file in *.cpp *.h; do
|
|
|
|
action $file
|
|
|
|
done
|