also put svn revision (svnversion(1)) and build type into the version string
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Jun 2008 11:20:33 +0000 (11:20 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 11 Jun 2008 11:20:33 +0000 (11:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8353 d7cf8633-e32d-0410-b094-e92efae38249

builddate.c
makefile.inc

index dcf45be..912252b 100644 (file)
@@ -1,3 +1,11 @@
+#define STRINGIFY2(arg) #arg
+#define STRINGIFY(arg) STRINGIFY2(arg)
 
-char *buildstring = __TIME__ " " __DATE__;
-
+char *buildstring = __TIME__ " " __DATE__
+#ifdef SVNREVISION
+" " STRINGIFY(SVNREVISION)
+#endif
+#ifdef BUILDTYPE
+" " STRINGIFY(BUILDTYPE)
+#endif
+;
index 5356783..ab8a448 100644 (file)
@@ -170,9 +170,9 @@ DO_CC=$(CC) $(CFLAGS) -c $< -o $@
 
 
 # Link
-LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG)
-LDFLAGS_PROFILE=-g -pg $(OPTIM_RELEASE)
-LDFLAGS_RELEASE=$(OPTIM_RELEASE)
+LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=debug
+LDFLAGS_PROFILE=-g -pg $(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=profile
+LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=release
 
 
 ##### UNIX specific variables #####