#!/bin/bash

# $1 - src pathname of PROCA/VERSION
# $2 - dst pathname of proca_version_suffix.h file
src_file=$1
dst_file=$2

VERSION=`cat ${src_file}`

if [[ ${VERSION} =~ ^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$ ]] ;
then
   VERSION_DEFINE="#define VERSION_SUFFIX \",version_${VERSION},release,${USER}\""
else
   VERSION_DEFINE="#error VERSION in file ${src_file} does not match to pattern 000.000.000"
fi

echo ${VERSION_DEFINE} > ${dst_file}
