#!/bin/sh
DIR=`dirname $0`
FILE=$DIR/../include/btstack/version.h
COMMIT=`git log -1 --pretty=format:%h`
MAJOR=0
MINOR=9
DATE=`date "+%Y-%m-%d_%H:%M:%S"`
printf "// BTstack - version.h\n" > $FILE
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
