mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-04 18:45:05 +01:00
makes the svnrev shit fit for linux. remove svnrev.c
This commit is contained in:
parent
ca2ad941f0
commit
4147f980dc
4
Makefile
4
Makefile
@ -55,7 +55,8 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||
#---------------------------------------------------------------------------------
|
||||
# automatically build a list of object files for our project
|
||||
#---------------------------------------------------------------------------------
|
||||
export CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
SVNREV := $(shell sh ./svnrev.sh)
|
||||
export CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||
export CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
||||
@ -124,7 +125,6 @@ release:
|
||||
else
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
SVNREV := $(shell ../svnrev.sh)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# main targets
|
||||
|
@ -1,7 +0,0 @@
|
||||
#define SVN_REV "675M"
|
||||
|
||||
const char *GetRev()
|
||||
{
|
||||
return SVN_REV;
|
||||
}
|
||||
|
42
svnrev.sh
42
svnrev.sh
@ -1,20 +1,22 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
a=$(svnversion -n ..)
|
||||
[ -n "$a" ] || a=$(SubWCRev .. | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
|
||||
[ -f ../source/svnrev.c ] || touch ../source/svnrev.c
|
||||
|
||||
b=$(cat ../source/svnrev.c | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
|
||||
if [ "$a" != "$b" ]; then
|
||||
echo '#define SVN_REV "'$a'"' > ../source/svnrev.c
|
||||
echo '' >> ../source/svnrev.c
|
||||
echo 'const char *GetRev()' >> ../source/svnrev.c
|
||||
echo '{ ' >> ../source/svnrev.c
|
||||
echo ' return SVN_REV;' >> ../source/svnrev.c
|
||||
echo '}' >> ../source/svnrev.c
|
||||
echo '' >> ../source/svnrev.c
|
||||
echo 'svnrev changed' >&2
|
||||
fi
|
||||
echo $a
|
||||
#! /bin/sh
|
||||
#
|
||||
a=$(svnversion -n . 2> /dev/null)
|
||||
[ -n "$a" ] || a=$(SubWCRev . 2> /dev/null| tr -d '\n' | sed 's/[^0-9]*[0-9]*[^0-9]*\([0-9]*\).*/\1/')
|
||||
|
||||
[ -f ./source/svnrev.c ] || touch ./source/svnrev.c
|
||||
|
||||
b=$(cat ./source/svnrev.c | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/')
|
||||
|
||||
if [ "$a" != "$b" ] || [ ! -n "$a" ]; then
|
||||
[ -n "$a" ] || a='unknow'
|
||||
echo '#define SVN_REV "'$a'"' > ./source/svnrev.c
|
||||
echo '' >> ./source/svnrev.c
|
||||
echo 'const char *GetRev()' >> ./source/svnrev.c
|
||||
echo '{ ' >> ./source/svnrev.c
|
||||
echo ' return SVN_REV;' >> ./source/svnrev.c
|
||||
echo '}' >> ./source/svnrev.c
|
||||
echo '' >> ./source/svnrev.c
|
||||
echo "Changed Rev $b to $a" >&2
|
||||
echo >&2
|
||||
fi
|
||||
echo $a
|
||||
|
Loading…
Reference in New Issue
Block a user