blob: 740454f5c2d725f92b36dad64e2d3cdc40af00c1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh -
PROG=${1-UNKNOWN}
if [ ! -f .version ]; then
echo 0 > .version
fi
RUN="`cat .version`"
RUN="`expr $RUN + 1`"
echo $RUN > .version
DATE="`date`"
TOPDIR=`echo $0 | sed -e 's;mkversion;..;'`
if [ -r VERSION ]; then
VERSION=VERSION
else if [ -r ${TOPDIR}/VERSION ]; then
VERSION=${TOPDIR}/VERSION
else
VERSION=../VERSION
fi; fi
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-
|