removed dependency on 'readlink -f'
[rapper.git] / tools / lpcrc / lpcrc.sh
1 #!/bin/sh
2
3 binary=$1
4 source=$2
5
6 lpcrc=$(echo $0 | sed -e 's/.sh$//g')
7
8 crcoutput=$($lpcrc $1)
9
10 echo "$crcoutput" | grep -q differs
11 if [ $? -eq 0 ] ; then
12         crc=$(echo "$crcoutput" | grep new_crc | cut -d' ' -f2)
13         sed -i -e \
14           's/^\(#define CRC_CHECKSUM 0x\)[a-f0-9]\{8\}$/\1'$crc'/g' \
15           $source
16         make crc
17 fi