mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-05 02:55:07 +01:00
f3296b3570
* all files that refere SVN_REV are automatically recompile
18 lines
528 B
Bash
18 lines
528 B
Bash
#! /bin/sh
|
|
#
|
|
a=$(svnversion -n ..)
|
|
[ -n "$a" ] || a=$(SubWCRev .. | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
|
|
|
[ -f ../source/svnrev.h ] || touch ../source/svnrev.h
|
|
|
|
b=$(cat ../source/svnrev.h | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
|
|
|
if [ $a -ne $b ]; then
|
|
echo '#ifndef SVNREV_H' > ../source/svnrev.h
|
|
echo ' #define SVNREV_H' >> ../source/svnrev.h
|
|
echo ' #define SVN_REV "'$a'"' >> ../source/svnrev.h
|
|
echo '#endif /* SVNREV_H */' >> ../source/svnrev.h
|
|
echo 'svnrev.h changed' >&2
|
|
fi
|
|
echo $a
|