SED ?= sed
# optional:
-SVNVERSION ?= svnversion
+GIT ?= git
STDOUT_TO_DEVNULL ?= >/dev/null
STDERR_TO_DEVNULL ?= 2>/dev/null
# Executable extension
RADIANT_EXECUTABLE := $(EXE)
-SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(SED) 's/M$$//g; s/.*://g;')
-ifneq ($(SVN_VERSION),)
- RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION)
- Q3MAP_VERSION := $(Q3MAP_VERSION)-svn$(SVN_VERSION)
+GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL))
+ifneq ($(GIT_VERSION),)
+ RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION)
+ Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
endif
CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""