Replace svnversion use with git equivalent

This commit is contained in:
Tim Angus 2013-01-03 21:08:28 +00:00
parent 2d02694749
commit f6c98fd29f

View file

@ -268,20 +268,13 @@ ifneq ($(BUILD_CLIENT),0)
endif
# Add svn version info
USE_SVN=
ifeq ($(wildcard .svn),.svn)
SVN_REV=$(shell LANG=C svnversion .)
ifneq ($(SVN_REV),)
VERSION:=$(VERSION)_SVN$(SVN_REV)
USE_SVN=1
USE_GIT=
ifeq ($(wildcard .git),.git)
GIT_REV=$(shell git show -s --pretty=format:%h-%ad --date=short)
ifneq ($(GIT_REV),)
VERSION:=$(VERSION)_GIT_$(GIT_REV)
USE_GIT=1
endif
else
ifeq ($(wildcard .git/svn/.metadata),.git/svn/.metadata)
SVN_REV=$(shell LANG=C git svn info | awk '$$1 == "Revision:" {print $$2; exit 0}')
ifneq ($(SVN_REV),)
VERSION:=$(VERSION)_SVN$(SVN_REV)
endif
endif
endif
@ -2463,11 +2456,11 @@ $(B)/ded/%.o: $(SYSDIR)/%.rc
$(B)/ded/%.o: $(NDIR)/%.c
$(DO_DED_CC)
# Extra dependencies to ensure the SVN version is incorporated
ifeq ($(USE_SVN),1)
$(B)/client/cl_console.o : .svn/entries
$(B)/client/common.o : .svn/entries
$(B)/ded/common.o : .svn/entries
# Extra dependencies to ensure the git version is incorporated
ifeq ($(USE_GIT),1)
$(B)/client/cl_console.o : .git/index
$(B)/client/common.o : .git/index
$(B)/ded/common.o : .git/index
endif