Generate a ver.cpp on every make all but not on make stepmania, unless ver.cpp does not exist.

This commit is contained in:
Steve Checkoway
2008-01-03 02:35:20 +00:00
parent e63061b675
commit ce8f578f0c
2 changed files with 21 additions and 0 deletions
+18
View File
@@ -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)
@@ -24,6 +24,9 @@
#endif
#endif
/* For RageLog */
#define HAVE_VERSION_INFO
#include "archutils/Common/gcc_byte_swaps.h"
#endif