From a926077b4d7c2ba84a8f449ae109aa0ef7202fd9 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 30 May 2013 16:42:10 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9945 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-ATC/Install.sh | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/USER-ATC/Install.sh b/src/USER-ATC/Install.sh index 1dc236491f..7659bbf955 100755 --- a/src/USER-ATC/Install.sh +++ b/src/USER-ATC/Install.sh @@ -1,5 +1,34 @@ # Install/unInstall package files in LAMMPS -# edit 2 Makefile.package files to include/exclude ATC info +# mode = 0/1/2 for uninstall/install/update + +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 + +# edit 2 Makefile.package files to include/exclude package info if (test $1 = 1) then @@ -21,9 +50,6 @@ include ..\/..\/lib\/atc\/Makefile.lammps ' ../Makefile.package.settings fi - cp fix_atc.h .. - cp fix_atc.cpp .. - elif (test $1 = 0) then if (test -e ../Makefile.package) then @@ -34,7 +60,4 @@ elif (test $1 = 0) then sed -i -e '/^include.*atc.*$/d' ../Makefile.package.settings fi - rm -f ../fix_atc.h - rm -f ../fix_atc.cpp - fi