#! /bin/sh
#	MC68010 Tiny Monitor -- make-version
#	Copyright (C) 1988 Philip L. Budne
#
#	May be freely distributed and used for non-profit use only,
#	provided this, and all other Copyright notices remain intact.
#
#	Commercial use is strictly forbidden without explicit, written
#	permission of the author.

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'
