-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_version
More file actions
executable file
·35 lines (33 loc) · 1.11 KB
/
make_version
File metadata and controls
executable file
·35 lines (33 loc) · 1.11 KB
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
#!/bin/sh
compiler=$1
branch=`git rev-parse --abbrev-ref HEAD 2>/dev/null`
commit=`git rev-parse --verify --short=12 HEAD 2>/dev/null`
commitcnt=`git rev-list --first-parent --count HEAD 2>/dev/null`
versionstring="$branch-n$commitcnt-$commit"
builddate=`date`
buildhost=`uname -n`
builduser=`whoami`
buildpath=`pwd`
buildsys=`uname`
buildarch=`uname -m`
case "$buildsys" in
SunOS | NetBSD)
buildtime=`date -u "+%FT%T+00:00"`
;;
*)
buildtime=`date -u -Iseconds`
;;
esac
buildstring="es-mveety $compiler $versionstring $builduser@$buildhost:$buildpath $buildsys $buildarch"
echo "/* autogenerated file! do not edit! */"
echo "/* produced by make_version */"
echo "#include \"es.h\""
echo "static const char version1[] = \"$versionstring\";"
echo "static const char buildstring1[] = \"$buildstring\";"
echo "static const char buildtime1[] = \"$buildtime\";"
echo "static const char sccs_id[] = \"@(#) $buildstring\";"
echo "const char * const version = version1;"
echo "const char * const buildstring = buildstring1;"
echo "const char * const buildtime = buildtime1;"
echo "const char * const sccs_id1 = sccs_id;"
echo ""