forked from treefrogframework/treefrog-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_rev.sh
More file actions
executable file
·24 lines (16 loc) · 740 Bytes
/
update_rev.sh
File metadata and controls
executable file
·24 lines (16 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
FILE_PATH=src/tglobal.h
cd `dirname $0`
. ./tfbase.pri
sed -i -e "s/^#define TF_VERSION_STR.*/#define TF_VERSION_STR \"${TF_VER_MAJ}\.${TF_VER_MIN}\.${TF_VER_PAT}\"/" $FILE_PATH
[ ${TF_VER_MAJ} -lt 10 ] && TF_VER_MAJ=0${TF_VER_MAJ}
[ ${TF_VER_MIN} -lt 10 ] && TF_VER_MIN=0${TF_VER_MIN}
[ ${TF_VER_PAT} -lt 10 ] && TF_VER_PAT=0${TF_VER_PAT}
sed -i -e "s/^#define TF_VERSION_NUMBER.*/#define TF_VERSION_NUMBER 0x${TF_VER_MAJ}${TF_VER_MIN}${TF_VER_PAT}/" $FILE_PATH
[ which git >/dev/null 2>&1 ] && exit 1
PROJ_REV=`git rev-list HEAD | wc -l`
if [ -n "$PROJ_REV" ]; then
REV=`expr $PROJ_REV + 1`
sed -i -e "s/^#define TF_SRC_REVISION.*/#define TF_SRC_REVISION $REV/" $FILE_PATH
echo "revision string updated : $REV"
fi