From 2b9ddf260d2c47c805d7daa970e9b00fa4440e3d Mon Sep 17 00:00:00 2001 From: Ivailo Spasov Date: Mon, 21 Jan 2013 15:54:05 +0200 Subject: [PATCH] Print git version hash if available --- Makefile | 6 ++++++ l4dtoolz_mm.cpp | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 51f72a8..b6573ba 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ # (C)2004-2010 Metamod:Source Development Team # Makefile written by David "BAILOPAN" Anderson +GIT_VERSION = $(shell sh -c 'git describe --abbrev=8 --dirty --always') + ########################################### ### EDIT THESE PATHS FOR YOUR OWN SETUP ### ########################################### @@ -46,6 +48,10 @@ ifeq "$(ENGINE)" "left4dead2" CFLAGS += -DSOURCE_ENGINE=9 -DL4D2 endif +ifneq "$(GIT_VERSION)" "" + CFLAGS += -D__GIT_VERSION=\"$(GIT_VERSION)\" +endif + HL2PUB = $(HL2SDK)/public diff --git a/l4dtoolz_mm.cpp b/l4dtoolz_mm.cpp index 4309c57..ee33077 100644 --- a/l4dtoolz_mm.cpp +++ b/l4dtoolz_mm.cpp @@ -270,7 +270,11 @@ const char *l4dtoolz::GetLicense() const char *l4dtoolz::GetVersion() { - return "1.0.0.9f"; +#ifdef __GIT_VERSION + return __GIT_VERSION; +#else + return "1.0.0.9g-unknown"; +#endif } const char *l4dtoolz::GetDate()