From c24c08599fb120990f071b1c2d88d35d1385e269 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 31 May 2014 12:26:13 +0000 Subject: [PATCH] Better compile timestamp handling. git-svn-id: https://svn.eduke32.com/eduke32@4495 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile | 2 ++ polymer/eduke32/Makefile.deps | 8 ++++---- polymer/eduke32/source/astub.c | 24 +++++------------------- polymer/eduke32/source/common.c | 17 +++++++++++++++++ polymer/eduke32/source/game.c | 19 ++----------------- polymer/eduke32/source/global.c | 3 --- polymer/eduke32/source/global.h | 2 ++ polymer/eduke32/source/rev.c | 6 ++++++ 8 files changed, 38 insertions(+), 43 deletions(-) create mode 100644 polymer/eduke32/source/rev.c diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 10f35465b..c24363422 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -98,6 +98,7 @@ GAMEOBJS=$(OBJ)/game.$o \ $(OBJ)/actors.$o \ $(OBJ)/anim.$o \ $(OBJ)/common.$o \ + $(OBJ)/rev.$o \ $(OBJ)/config.$o \ $(OBJ)/demo.$o \ $(OBJ)/gamedef.$o \ @@ -122,6 +123,7 @@ GAMEOBJS=$(OBJ)/game.$o \ EDITOROBJS=$(OBJ)/astub.$o \ $(OBJ)/common.$o \ + $(OBJ)/rev.$o \ $(OBJ)/m32def.$o \ $(OBJ)/m32exec.$o \ $(OBJ)/m32vars.$o \ diff --git a/polymer/eduke32/Makefile.deps b/polymer/eduke32/Makefile.deps index bd42755db..a096ed0d7 100644 --- a/polymer/eduke32/Makefile.deps +++ b/polymer/eduke32/Makefile.deps @@ -36,7 +36,7 @@ gamedef_h=$(SRC)/gamedef.h $(SRC)/gameexec.h $(SRC)/gamevars.h game_defs_dep=$(SRC)/lunatic/defs.ilua -$(OBJ)/game.$o: $(SRC)/game.c $(game_defs_dep) $(SRC)/jmact/scriplib.h $(duke3d_h) $(SRC)/input.h $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h $(INC)/demo.h $(EINC)/hightile.h $(SRC)/rev.h +$(OBJ)/game.$o: $(SRC)/game.c $(game_defs_dep) $(SRC)/jmact/scriplib.h $(duke3d_h) $(SRC)/input.h $(INC)/osdfuncs.h $(INC)/osdcmds.h $(INC)/grpscan.h $(INC)/demo.h $(EINC)/hightile.h $(OBJ)/actors.$o: $(SRC)/actors.c $(duke3d_h) $(OBJ)/anim.$o: $(SRC)/anim.c $(duke3d_h) $(SRC)/input.h $(SRC)/jmact/animlib.h $(SRC)/animvpx.h $(OBJ)/demo.$o: $(SRC)/demo.c $(duke3d_h) $(SRC)/input.h @@ -44,7 +44,7 @@ $(OBJ)/gamedef.$o: $(SRC)/gamedef.c $(duke3d_h) $(gamedef_h) $(SRC)/savegame.h $(OBJ)/gameexec.$o: $(SRC)/gameexec.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(OBJ)/gamestructures.$o: $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(OBJ)/gamevars.$o: $(SRC)/gamevars.c $(SRC)/gamestructures.c $(duke3d_h) $(gamedef_h) $(SRC)/savegame.h -$(OBJ)/global.$o: $(SRC)/*.c $(SRC)/global.c $(duke3d_h) $(SRC)/rev.h +$(OBJ)/global.$o: $(SRC)/*.c $(SRC)/global.c $(duke3d_h) $(OBJ)/input.$o: $(SRC)/input.c $(duke3d_h) $(SRC)/input.h $(OBJ)/mdump.$o: $(SRC)/mdump.cpp $(SRC)/mdump.h $(OBJ)/menus.$o: $(SRC)/menus.c $(duke3d_h) $(SRC)/input.h $(SRC)/jmact/mouse.h @@ -62,6 +62,7 @@ $(OBJ)/winbits.$o: $(SRC)/winbits.c $(OBJ)/osdfuncs.$o: $(SRC)/names.h $(EINC)/build.h $(EINC)/osd.h $(OBJ)/osdcmds.$o: $(SRC)/osdcmds.c $(INC)/osdcmds.h $(EINC)/osd.h $(duke3d_h) $(OBJ)/animvpx.$o: $(SRC)/animvpx.c $(SRC)/animvpx.h $(duke3d_h) $(EINC)/glbuild.h +$(OBJ)/rev.$o: $(SRC)/rev.h $(OBJ)/lunatic_game.$o: $(EINC)/lunatic.h $(SRC)/lunatic/lunatic_game.c $(SRC)/lunatic/lunatic_game.h $(SRC)/gamedef.h $(SRC)/gameexec.h $(EINC)/cache1d.h $(EINC)/osd.h $(OBJ)/lunatic_m32.$o: $(EINC)/lunatic.h $(SRC)/lunatic/lunatic_m32.c $(SRC)/lunatic/lunatic_m32.h $(EINC)/cache1d.h $(EINC)/osd.h @@ -84,8 +85,7 @@ $(OBJ)/astub.$o: $(SRC)/astub.c \ $(SRC)/names.h \ $(SRC)/mapster32.h \ $(SRC)/keys.h \ - $(m32_script_hs) \ - $(SRC)/rev.h + $(m32_script_hs) $(OBJ)/sounds_mapster32.$o: $(SRC)/sounds_mapster32.c \ $(SRC)/sounds_mapster32.h \ $(SRC)/sounds_common.h \ diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 5d5a80ae0..3e2c09540 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -56,8 +56,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # include "lunatic_m32.h" #endif -static const char * - #include "rev.h" +extern const char *s_buildRev; +extern const char *s_buildTimestamp; +extern const char *s_buildInfo; #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -8941,23 +8942,8 @@ int32_t ExtPreInit(int32_t argc,const char **argv) OSD_SetLogFile("mapster32.log"); OSD_SetVersion("Mapster32" " " VERSION,0,2); - initprintf("Mapster32 %s %s" -#ifdef BITNESS64 - " (64-bit)" -#else - " (32-bit)" -#endif -#if defined (_MSC_VER) || defined(__cplusplus) -#ifdef _MSC_VER - " MSVC" -#endif -#ifdef __cplusplus - " C++" -#endif - " build" -#endif - "\n", VERSION, s_buildRev); - initprintf("Compiled %s\n", __DATE__ " " __TIME__); + initprintf("Mapster32 %s %s %s\n", VERSION, s_buildRev, s_buildInfo); + initprintf("Compiled %s\n", s_buildTimestamp); // initprintf("Copyright (c) 2008 EDuke32 team\n"); G_CheckCommandLine(argc,argv); diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index f85611775..f7d7ddfb6 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -22,6 +22,23 @@ #include "common.h" #include "common_game.h" +const char* s_buildInfo = +#ifdef BITNESS64 + "(64-bit)" +#else + "(32-bit)" +#endif +#if defined (_MSC_VER) || defined(__cplusplus) +#ifdef _MSC_VER + " MSVC" +#endif +#ifdef __cplusplus + " C++" +#endif + " build" +#endif +; + int32_t g_gameType = GAMEFLAG_DUKE; // grp/con/def handling diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 125116cb5..d850cee35 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -11254,23 +11254,8 @@ int32_t app_main(int32_t argc, const char **argv) wm_setapptitle(APPNAME); - initprintf(HEAD2 " %s" -#ifdef BITNESS64 - " (64-bit)" -#else - " (32-bit)" -#endif -#if defined (_MSC_VER) || defined(__cplusplus) -#ifdef _MSC_VER - " MSVC" -#endif -#ifdef __cplusplus - " C++" -#endif - " build" -#endif - "\n", s_buildRev); - initprintf("Compiled %s\n", __DATE__ " " __TIME__); + initprintf(HEAD2 " %s %s\n", s_buildRev, s_buildInfo); + initprintf("Compiled %s\n", s_buildTimestamp); if (!usecwd) G_AddSearchPaths(); diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 9d90831e9..42527a78e 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -26,9 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. user_defs ud; -const char * - #include "rev.h" - const char *s_buildDate = "20120522"; // JBF: g_spriteGravity modified to default to Atomic ed. default when using 1.3d CONs diff --git a/polymer/eduke32/source/global.h b/polymer/eduke32/source/global.h index c481c3f97..c6fd2910a 100644 --- a/polymer/eduke32/source/global.h +++ b/polymer/eduke32/source/global.h @@ -132,6 +132,8 @@ G_EXTERN int32_t g_noEnemies; #ifndef __global_c__ G_EXTERN const char *s_buildRev; G_EXTERN const char *s_buildDate; +G_EXTERN const char *s_buildTimestamp; +G_EXTERN const char *s_buildInfo; G_EXTERN int32_t g_spriteGravity; G_EXTERN int16_t g_spriteDeleteQueueSize; G_EXTERN char EpisodeNames[MAXVOLUMES][33]; diff --git a/polymer/eduke32/source/rev.c b/polymer/eduke32/source/rev.c new file mode 100644 index 000000000..6affa46c6 --- /dev/null +++ b/polymer/eduke32/source/rev.c @@ -0,0 +1,6 @@ +// This file's main purpose is to be recompiled whenever the Makefile slams rev.h (usually always) so the timestamp gets updated, even for a partial recompile. + +const char * + #include "rev.h" + +const char* s_buildTimestamp = __DATE__ " " __TIME__;