-
Notifications
You must be signed in to change notification settings - Fork 315
/
GETVERSION
executable file
·28 lines (26 loc) · 978 Bytes
/
GETVERSION
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
#!/bin/sh
#
# ${RHOME}/tools/GETVERSION
TOOLS_DIR=`echo ${0} | sed 's%/[^/][^/]*$%%'`
(cd ${TOOLS_DIR}/..
maj=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\1/' < VERSION`
min=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\2/' < VERSION`
rev=`sed 's/\([^ .]*\).\([^ ]*\) *\(.*\)/\3/' < VERSION`
pl=`echo ${min} | sed 's/\..*//'`
sl=`echo ${min} | sed 's/.*\.//'`
ver=`expr ${maj} \\* 65536 + ${pl} \\* 256 + ${sl}`
y=`cut -d/ -f1 < date-stamp`
m=`cut -d/ -f2 < date-stamp`
d=`cut -d/ -f3 < date-stamp`
echo "/* Rversion.h. Generated automatically. */"
echo "#ifndef R_VERSION_H"
echo "#define R_VERSION_H"
echo "#define R_VERSION ${ver}"
echo "#define R_Version(v,p,s) (((v) * 65536) + ((p) * 256) + (s))"
echo "#define R_MAJOR \"${maj}\""
echo "#define R_MINOR \"${min}\""
echo "#define R_STATUS \"${rev}\""
echo "#define R_YEAR \"${y}\""
echo "#define R_MONTH \"${m}\""
echo "#define R_DAY \"${d}\""
echo "#endif /* not R_VERSION_H */")