From 03115492844ba397b068b9e43fc84e32699de60f Mon Sep 17 00:00:00 2001 From: rpolzer Date: Wed, 17 Sep 2008 13:45:02 +0000 Subject: [PATCH] detect svn version git-svn-id: svn://svn.icculus.org/netradiant/trunk@83 61c419a2-8eb2-4b30-bcec-8cead039b335 --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 8d827172..4ae85201 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,13 @@ CP_R ?= $(CP) -r RM ?= rm RM_R ?= $(RM) -r TEE_STDERR ?= | tee /dev/stderr +TR ?= tr FIND ?= find DIFF ?= diff +# optional: +SVNVERSION ?= svnversion + STDOUT_TO_DEVNULL ?= >/dev/null STDERR_TO_DEVNULL ?= 2>/dev/null STDERR_TO_STDOUT ?= 2>&1 @@ -146,6 +150,12 @@ endif RADIANT_VERSION = 1.5.0 RADIANT_MAJOR_VERSION = 5 RADIANT_MINOR_VERSION = 0 + +SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(TR) -cd 0-9:) +ifneq ($(SVN_VERSION),) + RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION) +endif + CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" .PHONY: all @@ -187,6 +197,7 @@ dependencies-check: checkbinary coreutils "$(RM)"; \ checkbinary coreutils "$(RM_R)"; \ checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \ + checkbinary coreutils "$(TR)"; \ checkbinary findutils "$(FIND)"; \ checkbinary diff "$(DIFF)"; \ checkbinary gcc "$(CC)"; \ -- 2.39.2