#! /bin/sh
#
# copyfilesfromAD
#
# remove local AutoGrid versions of key source files shared with AutoDock,
#  replacing them with copies from ../autodock
# 
# option -b   : is being run from build dir rather src dir
# option -r   : removes these files, does not copy 
#
# $Id: copyfilesfromAD,v 1.3 2012/11/01 22:17:05 rhuey Exp $
#
# M Pique

prefix=".."  # where 'autodock' dir is from src dir
if [ test$1 = test-b ]; then
   prefix="../.."  # where 'autodock' dir is from build dir
fi

copy=y
if [ test$1 = test-r ]; then
  copy=n
fi

DO="ln -s"
DO="cp -p"

# .cpp and .h if present in ../autodock
for c in  \
	mingw_getrusage \
	mingw_sysconf \
	mingw_sys_times \
	parse_param_line \
	printhms \
	printdate \
	read_parameter_library \
	stop \
	timesys \
	timesyshms \
  ; do
   rm -f $c.cpp $c.h
   test $copy = y && test -r ${prefix}/autodock/$c.cc && $DO  ${prefix}/autodock/$c.cc $c.cpp
   test $copy = y && test -r ${prefix}/autodock/$c.h && $DO  ${prefix}/autodock/$c.h  $c.h
done

