4 VERSION_TARGET=version.h
6 VERSION_STR=$(git show | grep ^commit | sed -e s.commit\ .. | cut -b -10)
9 COMPILER_STR_TARGET=.compiler_check
10 COMPILER_STR_TMP=$COMPILER_CHECK.tmp
13 echo "#ifndef _VERSION_H_" >> $VERSION_TMP
14 echo "#define _VERSION_H_" >> $VERSION_TMP
16 echo "/* Autogenerated version.h file */" >> $VERSION_TMP
18 echo "#define LOG-PLOTTER_VERSION \"$VERSION_STR\"" >> $VERSION_TMP
20 echo "#endif" >> $VERSION_TMP
22 if [ -f $VERSION_TARGET ] ; then
23 cmp -s $VERSION_TMP $VERSION_TARGET || cp $VERSION_TMP $VERSION_TARGET
25 cp $VERSION_TMP $VERSION_TARGET
28 echo $COMPILER_STR > $COMPILER_STR_TMP
30 if [ -f $COMPILER_STR_TARGET ] ; then
31 cmp -s $COMPILER_STR_TMP $COMPILER_STR_TARGET || \
32 cp $COMPILER_STR_TMP $COMPILER_STR_TARGET
34 cp $COMPILER_STR_TMP $COMPILER_STR_TARGET