git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3753 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-01-29 16:14:11 +00:00
parent ec163d98d7
commit 63d001f274
4 changed files with 92 additions and 19 deletions

73
src/Make.sh Normal file
View File

@ -0,0 +1,73 @@
# Make.sh = update Makefile.lib or Makefile.list or style_*.h files
# Syntax: sh Make.sh style
# sh Make.sh Makefile.lib
# sh Make.sh Makefile.list
# function to create one style_*.h file
style () {
list=`grep -l $1 $2*.h`
if (test -e style_$3.tmp) then
rm style_$3.tmp
fi
for file in $list; do
qfile="\"$file\""
echo "#include $qfile" >> style_$3.tmp
done
if (test ! -e style_$3.tmp) then
rm style_$3.h
touch style_$3.h
elif (test ! -e style_$3.h) then
mv style_$3.tmp style_$3.h
rm Obj_*/$4.d
elif (test "`diff --brief style_$3.h style_$3.tmp`" != "") then
mv style_$3.tmp style_$3.h
rm Obj_*/$4.d
else
rm style_$3.tmp
fi
}
# create individual style files
# called by "make machine"
if (test $1 = "style") then
style ANGLE_CLASS angle_ angle force
style ATOM_CLASS atom_vec_ atom atom
style BOND_CLASS bond_ bond force
style COMMAND_CLASS "" command input
style COMPUTE_CLASS compute_ compute modify
style DIHEDRAL_CLASS dihedral_ dihedral force
style DUMP_CLASS dump_ dump output
style FIX_CLASS fix_ fix modify
style IMPROPER_CLASS improper_ improper force
style INTEGRATE_CLASS "" integrate update
style KSPACE_CLASS "" kspace force
style MINIMIZE_CLASS min_ minimize update
style PAIR_CLASS pair_ pair force
style REGION_CLASS region_ region domain
# edit Makefile.lib
# called by "make makelib"
# use current list of *.cpp and *.h files in src dir w/out main.cpp
elif (test $1 = "Makefile.lib") then
list=`ls -1 *.cpp | sed s/^main\.cpp// | tr "[:cntrl:]" " "`
sed -i -e "s/SRC = .*/SRC = $list/" Makefile.lib
list=`ls -1 *.h | tr "[:cntrl:]" " "`
sed -i -e "s/INC = .*/INC = $list/" Makefile.lib
# edit Makefile.list
# called by "make makelist"
# use current list of *.cpp and *.h files in src dir
elif (test $1 = "Makefile.list") then
list=`ls -1 *.cpp | tr "[:cntrl:]" " "`
sed -i -e "s/SRC = .*/SRC = $list/" Makefile.list
list=`ls -1 *.h | tr "[:cntrl:]" " "`
sed -i -e "s/INC = .*/INC = $list/" Makefile.list
fi

View File

@ -62,7 +62,7 @@ help:
.DEFAULT:
@test -f MAKE/Makefile.$@
@if [ ! -d Obj_$@ ]; then mkdir Obj_$@; fi
@csh Make.csh style
@/bin/sh Make.sh style
@cp -p *.cpp *.h Obj_$@
@cp MAKE/Makefile.$@ Obj_$@/Makefile
@cp Makefile.package Obj_$@
@ -87,7 +87,7 @@ clean-%:
tar:
@cd STUBS; make clean
@cd ..; tar cvzf src/$(ROOT)_src.tar.gz \
src/Make* src/Package.csh src/MAKE src/*.cpp src/*.h src/STUBS \
src/Make* src/Package.sh src/MAKE src/*.cpp src/*.h src/STUBS \
$(patsubst %,src/%,$(PACKAGEUC)) $(patsubst %,src/%,$(PACKUSERUC)) \
--exclude=*/.svn
@cd STUBS; make
@ -96,10 +96,10 @@ tar:
# Update Makefile.lib and Makefile.list
makelib:
@csh Make.csh Makefile.lib
@/bin/sh Make.sh Makefile.lib
makelist:
@csh Make.csh Makefile.list
@/bin/sh Make.sh Makefile.list
# Package management
@ -145,7 +145,7 @@ yes-%:
echo "Package $(@:yes-%=%) does not exist"; \
else \
echo "Installing package $(@:yes-%=%)"; \
cd $(YESDIR); csh -f Install.csh 1; \
cd $(YESDIR); /bin/sh Install.sh 1; \
fi;
no-%:
@ -153,7 +153,7 @@ no-%:
echo "Package $(@:no-%=%) does not exist"; \
else \
echo "Uninstalling package $(@:no-%=%), ignore errors"; \
cd $(NODIR); csh -f Install.csh 0; cd ..; \
cd $(NODIR); /bin/sh Install.sh 0; cd ..; \
fi;
# status = list differences between src and package files
@ -161,16 +161,16 @@ no-%:
# overwrite = overwrite package files with newer src files
package-status:
@for p in $(PACKAGEUC); do csh -f Package.csh $$p status; done
@for p in $(PACKAGEUC); do /bin/sh Package.sh $$p status; done
@echo ''
@for p in $(PACKUSERUC); do csh -f Package.csh $$p status; done
@for p in $(PACKUSERUC); do /bin/sh Package.sh $$p status; done
package-update:
@for p in $(PACKAGEUC); do csh -f Package.csh $$p update; done
@for p in $(PACKAGEUC); do /bin/sh Package.sh $$p update; done
@echo ''
@for p in $(PACKUSERUC); do csh -f Package.csh $$p update; done
@for p in $(PACKUSERUC); do /bin/sh Package.sh $$p update; done
package-overwrite:
@for p in $(PACKAGEUC); do csh -f Package.csh $$p overwrite; done
@for p in $(PACKAGEUC); do /bin/sh Package.sh $$p overwrite; done
@echo ''
@for p in $(PACKUSERUC); do csh -f Package.csh $$p overwrite; done
@for p in $(PACKUSERUC); do /bin/sh Package.sh $$p overwrite; done

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long