mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-26 13:05:18 +01:00
c5de365eb7
when obj directories are in use.
37 lines
638 B
Bash
Executable File
37 lines
638 B
Bash
Executable File
#!/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-
|