Add git svnversion.h generation code

Signed-off-by: Russell Harmon <eatnumber1@gmail.com>

Switch from `` to POSIX preferred (and more readable) $()


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3224 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mentor 2008-01-21 08:59:27 +00:00
parent 52319f4d34
commit 3f942d694e
2 changed files with 6 additions and 2 deletions

View File

@ -66,10 +66,13 @@ endif
.PHONY: svnversion.h
svnversion.h:
@if [ -d .svn ]; then \
ver=`svnversion -nc . | sed -e 's/^[^:]*://;s/[A-Za-z]//'`; \
ver=$(svnversion -nc . | sed -e 's/^[^:]*://;s/[A-Za-z]//'); \
echo "#define SVNVERSION \"svn r$$ver\"" > $@.tmp; \
elif [ -d .git ]; then \
ver=$(git svn log | head -n2 | tail -n1 | cut -d\ -f1); \
echo "#define SVNVERSION \"svn $$ver\"" > $@.tmp; \
elif [ -s SNAPSHOT ]; then \
ver=`sed -e '/^Revision: */!d;s///;q' SNAPSHOT`; \
ver=$(sed -e '/^Revision: */!d;s///;q' SNAPSHOT); \
echo "#define SVNVERSION \"svn r$$ver\"" > $@.tmp; \
else \
touch $@.tmp; \

1
THANKS
View File

@ -128,6 +128,7 @@ Mike Taylor
Derek J Smithies
jhansen
Benoit Papillault
Russell Harmon
Apologies to anyone whose name was unintentionally left off.
Please let us know if you think your name should be mentioned here!