diff --git a/Makefile b/Makefile index 418cdba1..9ec65392 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,8 @@ export DEPSDIR := $(CURDIR)/$(BUILD) #--------------------------------------------------------------------------------- # automatically build a list of object files for our project #--------------------------------------------------------------------------------- -SVNREV := $(shell svnrev.sh) export CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) -export CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) +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))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) @@ -124,6 +123,7 @@ release: else DEPENDS := $(OFILES:.o=.d) +SVNREV := $(shell ../svnrev.sh) #--------------------------------------------------------------------------------- # main targets diff --git a/gui.pnproj b/gui.pnproj index 702c778b..e96873a4 100644 --- a/gui.pnproj +++ b/gui.pnproj @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/gui.pnps b/gui.pnps index a5e72cd6..09af7bfc 100644 --- a/gui.pnps +++ b/gui.pnps @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/source/svnrev.c b/source/svnrev.c new file mode 100644 index 00000000..510b8f81 --- /dev/null +++ b/source/svnrev.c @@ -0,0 +1,7 @@ +#define SVN_REV "649:652M" + +const char *GetRev() +{ + return SVN_REV; +} + diff --git a/svnrev.sh b/svnrev.sh index ad79f2f4..8d0b0142 100644 --- a/svnrev.sh +++ b/svnrev.sh @@ -1,20 +1,20 @@ #! /bin/sh # -a=$(svnversion -n .) -[ -n "$a" ] || a=$(SubWCRev . | tr -d '\n' | sed 's/[^0-9]*[0-9]*[^0-9]*\([0-9]*\).*/\1/') +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 +[ -f ../source/svnrev.c ] || touch ../source/svnrev.c -b=$(cat ./source/svnrev.c | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/') +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 '#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