From 78788d6944d1d5dee251006b411f7f1c97285a93 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 30 May 2013 16:31:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9941 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/REAX/Install.sh | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/REAX/Install.sh b/src/REAX/Install.sh index 0cb94a6b70..2c3aaf2302 100644 --- a/src/REAX/Install.sh +++ b/src/REAX/Install.sh @@ -1,5 +1,34 @@ # Install/unInstall package files in LAMMPS -# edit 2 Makefile.package files to include/exclude REAX 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,13 +50,6 @@ include ..\/..\/lib\/reax\/Makefile.lammps ' ../Makefile.package.settings fi - cp pair_reax.cpp .. - cp pair_reax.h .. - cp pair_reax_fortran.h .. - - cp fix_reax_bonds.h .. - cp fix_reax_bonds.cpp .. - elif (test $1 = 0) then if (test -e ../Makefile.package) then @@ -38,11 +60,4 @@ elif (test $1 = 0) then sed -i -e '/^include.*reax.*$/d' ../Makefile.package.settings fi - rm -f ../pair_reax.cpp - rm -f ../pair_reax.h - rm -f ../pair_reax_fortran.h - - rm -f ../fix_reax_bonds.h - rm -f ../fix_reax_bonds.cpp - fi