#! /bin/sh

if [ -r BUILD ]
then
    build=`cat BUILD`
    if expr $build + 1 > /dev/null 2>&1
    then
	build=`expr $build + 1`
    else
	echo bad BUILD file '"'$build'"' -- resetting 1>&2
	build=1
    fi
else
    echo creating new BUILD file 1>&2
    build=1
fi
echo $build > BUILD
echo build $build 1>&2

#echo '| This file is created by the script make-version'
#echo '	.text'
#echo '	.globl _verstr'
#echo '_verstr:'
#echo '	.ascii "#'$build': '`date`'"'
#echo '	.byte 13,10'
#echo '	.ascii "    '`whoami`'@'`hostname`':'`pwd`'"'
#echo '	.byte 13,10,0'

echo '/* this filed created by the script make-version */'
echo ''
echo 'const char verstr[] = "#'$build': '`date`'\r\n\'
echo '    '`whoami`'@'`hostname`':'`pwd`'\r\n";'
