From ce8f578f0c7faf7f0f0e0f8d0a81be863e82d954 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 3 Jan 2008 02:35:20 +0000 Subject: [PATCH] Generate a ver.cpp on every make all but not on make stepmania, unless ver.cpp does not exist. --- stepmania/src/Makefile.am | 18 ++++++++++++++++++ stepmania/src/archutils/Unix/arch_setup.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index 6981a02b0b..828bbda866 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -24,6 +24,23 @@ AM_CXXFLAGS += $(XCFLAGS) LIBS += LIBS += -lpthread -lrt +.PHONY: increment_version + +all: increment_version + +increment_version: + if test -e ver.cpp; then \ + build=`sed -rs 's/.*version_num = ([[:digit:]]+);/\1/;q' ver.cpp`; \ + build=`expr $$build + 1`; \ + else \ + build=0; \ + fi; \ + echo "extern const unsigned long version_num = $$build;" > ver.cpp; \ + echo "extern const char *const version_time = \"`date`\";" >> ver.cpp; + +ver.cpp: + $(MAKE) increment_version + Screens = \ Screen.cpp Screen.h ScreenAttract.cpp ScreenAttract.h \ ScreenBookkeeping.cpp ScreenBookkeeping.h \ @@ -566,6 +583,7 @@ main_LDADD = \ $(XLIBS) \ libtomcrypt.a libtommath.a +nodist_stepmania_SOURCES = ver.cpp stepmania_SOURCES = $(main_SOURCES) stepmania_LDADD = $(main_LDADD) diff --git a/stepmania/src/archutils/Unix/arch_setup.h b/stepmania/src/archutils/Unix/arch_setup.h index e741a2f68d..e6837dbfeb 100644 --- a/stepmania/src/archutils/Unix/arch_setup.h +++ b/stepmania/src/archutils/Unix/arch_setup.h @@ -24,6 +24,9 @@ #endif #endif +/* For RageLog */ +#define HAVE_VERSION_INFO + #include "archutils/Common/gcc_byte_swaps.h" #endif