From f6c98fd29f3eb18ab0bd69c870ac00394fab961f Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 3 Jan 2013 21:08:28 +0000 Subject: [PATCH] Replace svnversion use with git equivalent --- Makefile | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index f3a29eb6..8dce6af0 100644 --- a/Makefile +++ b/Makefile @@ -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