#! /bin/csh -f

# This shell script automatically runs upon a 'gmake commit'.  
# It updates the micro release version number of TCA.
#  Adapted by Reid Simmons from a version used for TCX

echo "Automatically updating micro version number in tcaInternal.h" 
echo "If you abort the commit, restore tcaInternal.h from .#tcaInternal.h.BAK"

rm -f $1/.\#tcaInternal.h.BAK
cp $1/tcaInternal.h $1/.\#tcaInternal.h.BAK

awk '/TCA_VERSION_MICRO/ { print "#define TCA_VERSION_MICRO  " $3+1 } \
     /VERSION_DATE/ { print "#define VERSION_DATE \"" date "\""} \
    !($2 ~ /TCA_VERSION_MICRO|VERSION_DATE/) { print }' \
   date=`date '+%h-%d-%y'` $1/.\#tcaInternal.h.BAK >! $1/tcaInternal.h

##############################################################################



