0001
0002
0003
0004 if [ $
0005 OUTPUT=$1
0006 fi
0007
0008 GVF=${OUTPUT}PERF-VERSION-FILE
0009
0010 LF='
0011 '
0012
0013
0014
0015
0016 CID=
0017 TAG=
0018 if test -d ../../.git -o -f ../../.git
0019 then
0020 TAG=$(MAKEFLAGS= make -sC ../.. kernelversion)
0021 CID=$(git log -1 --abbrev=12 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
0022 else
0023 TAG=$(cut -d' ' -f3 ../../PERF-VERSION-FILE | sed -e 's/\"//g')
0024 fi
0025
0026 VN="$TAG$CID"
0027 if test -n "$CID"
0028 then
0029
0030 VN=$(echo "$VN" | sed -e 's/-/./g;s/\([0-9]*[.][0-9]*\)[.]0/\1/')
0031 fi
0032
0033 VN=$(expr "$VN" : v*'\(.*\)')
0034
0035 if test -r $GVF
0036 then
0037 VC=$(sed -e 's/^#define PERF_VERSION "\(.*\)"/\1/' <$GVF)
0038 else
0039 VC=unset
0040 fi
0041 test "$VN" = "$VC" || {
0042 echo >&2 " PERF_VERSION = $VN"
0043 echo "#define PERF_VERSION \"$VN\"" >$GVF
0044 }
0045
0046