1993-12-21 18:36:48 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
PROG=${1-UNKNOWN}
|
|
|
|
if [ ! -f .version ]; then
|
|
|
|
echo 0 > .version
|
|
|
|
fi
|
|
|
|
|
|
|
|
RUN="`cat .version`"
|
|
|
|
RUN="`expr $RUN + 1`"
|
|
|
|
echo $RUN > .version
|
|
|
|
|
1997-06-30 10:59:25 +00:00
|
|
|
DATE="`LC_TIME=C date`"
|
1994-02-06 06:58:59 +00:00
|
|
|
TOPDIR=`echo $0 | sed -e 's;mkversion;..;'`
|
1993-12-21 18:36:48 +00:00
|
|
|
|
|
|
|
if [ -r VERSION ]; then
|
|
|
|
VERSION=VERSION
|
1994-02-06 06:58:59 +00:00
|
|
|
else if [ -r ${TOPDIR}/VERSION ]; then
|
|
|
|
VERSION=${TOPDIR}/VERSION
|
1993-12-21 18:36:48 +00:00
|
|
|
else
|
|
|
|
VERSION=../VERSION
|
1994-02-06 06:58:59 +00:00
|
|
|
fi; fi
|
1993-12-21 18:36:48 +00:00
|
|
|
|
|
|
|
if [ -f "$VERSION" ]; then
|
|
|
|
FLAGS="`egrep '^[0-9a-zA-Z_]+=' "$VERSION" | tr '\012' ';'` "
|
|
|
|
else
|
|
|
|
FLAGS=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Version $PROG ${FLAGS}${DATE} (${RUN})";
|
|
|
|
|
|
|
|
rm -f version.c
|
|
|
|
cat > version.c << -EoF-
|
|
|
|
/*
|
|
|
|
* version file for $PROG
|
|
|
|
*/
|
|
|
|
char * Version = "$PROG ${FLAGS}${DATE} (${RUN})";
|
|
|
|
-EoF-
|