btstack/tool/get_version.sh

16 lines
625 B
Bash
Raw Normal View History

2010-01-09 10:19:43 +00:00
#!/bin/sh
DIR=`dirname $0`
FILE=$DIR/../platform/daemon/src/btstack_version.h
COMMIT=`git log -1 --pretty=format:%h`
2018-08-22 12:42:14 +00:00
MAJOR=1
MINOR=0
2010-01-09 10:19:43 +00:00
DATE=`date "+%Y-%m-%d_%H:%M:%S"`
2016-01-20 15:11:27 +00:00
printf "// BTstack - btstack_version.h\n" > $FILE
2010-01-09 10:19:43 +00:00
printf "// - generated by %s\n" $0>> $FILE
printf "// - at %s\n" $DATE >> $FILE
printf "#define BTSTACK_MAJOR %u\n" $MAJOR >> $FILE
printf "#define BTSTACK_MINOR %u\n" $MINOR >> $FILE
printf "#define BTSTACK_COMMIT \"%s\"\n" $COMMIT >> $FILE
printf "#define BTSTACK_VERSION \"%u.%u-%s\"\n" $MAJOR $MINOR $COMMIT >> $FILE
printf "#define BTSTACK_DATE \"%s\"\n" $DATE >> $FILE