mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Nuke rev.h.
Note to MSVC users: You can get the revision number if you run `make rev o=obj` with MinGW before you build. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4565 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
b0e82d4264
commit
9a4a4a627b
8 changed files with 42 additions and 43 deletions
|
@ -346,11 +346,11 @@ DUKE3D_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_EDIT
|
|||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
.SILENT:
|
||||
endif
|
||||
.PHONY: veryclean clean all test cleanutils utils dxutils sdlutils printutils printsdlutils printdxutils rev rev_clean
|
||||
.PHONY: veryclean clean all test cleanutils utils dxutils sdlutils printutils printsdlutils printdxutils rev $(DUKE3D_OBJ)/rev.$o
|
||||
|
||||
# TARGETS
|
||||
|
||||
all: start $(DO_REV) $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
|
||||
all: start $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
|
||||
ifneq (,$(EDUKE32_TARGET))
|
||||
@ls -l $(EDUKE32)
|
||||
endif
|
||||
|
@ -565,6 +565,10 @@ $(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.c | $(DUKE3D_OBJ)
|
|||
$(COMPILE_STATUS)
|
||||
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
|
||||
|
||||
$(DUKE3D_OBJ)/rev.$o: $(DUKE3D_SRC)/rev.c | $(DUKE3D_OBJ)
|
||||
$(COMPILE_STATUS)
|
||||
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) $(REVFLAG) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
|
||||
|
||||
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/util/%.c | $(DUKE3D_OBJ)
|
||||
$(COMPILE_STATUS)
|
||||
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
|
||||
|
@ -603,7 +607,7 @@ $(ENGINE_OBJ) $(AUDIOLIB_OBJ) $(ENET_OBJ) $(DUKE3D_OBJ) $(TESTGAME_OBJ):
|
|||
|
||||
# PHONIES
|
||||
|
||||
clean: $(UNDO_REV)
|
||||
clean:
|
||||
-rm -f $(EDUKE32) $(MAPSTER32) $(COMMON_OBJS_EXP) $(DUKE3D_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(DUKE3D_EDITOR_OBJS_EXP) $(DUKE3D_MISCDEPS) $(DUKE3D_EDITOR_MISCDEPS) core*
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
-rm -rf EDuke32.app Mapster32.app
|
||||
|
@ -627,8 +631,4 @@ printdxutils:
|
|||
printsdlutils:
|
||||
echo "$(addsuffix $(EXESUFFIX),$(SDLUTILS))"
|
||||
|
||||
rev:
|
||||
@echo "s_buildRev = \"r$(VC_REV)$(VC_REV_CUSTOM)\";">source/rev.h
|
||||
|
||||
rev_clean:
|
||||
@$(VC_CLEAN) source/rev.h
|
||||
rev: $(DUKE3D_OBJ)/rev.$o
|
||||
|
|
|
@ -138,20 +138,6 @@ ifndef SUBPLATFORM
|
|||
endif
|
||||
endif
|
||||
|
||||
# Detect version control revision, if applicable
|
||||
ifeq (,$(VC_REV))
|
||||
VC_REV := $(shell svn info 2>&1 | grep Revision | cut -d' ' -f2)
|
||||
VC_CLEAN := svn revert
|
||||
endif
|
||||
ifeq (,$(VC_REV))
|
||||
VC_REV := $(shell git svn info 2>&1 | grep Revision | cut -d' ' -f2)
|
||||
VC_CLEAN := git checkout
|
||||
endif
|
||||
ifneq (,$(VC_REV))
|
||||
DO_REV :=rev
|
||||
UNDO_REV :=rev_clean
|
||||
endif
|
||||
|
||||
# Binary suffix override:
|
||||
EXESUFFIX_OVERRIDE ?=
|
||||
|
||||
|
@ -1000,6 +986,22 @@ ifeq ($(PLATFORM),WII)
|
|||
# -msdata=eabi
|
||||
endif
|
||||
|
||||
# Detect version control revision, if applicable
|
||||
ifeq (,$(VC_REV))
|
||||
ifneq (,$(wildcard EDUKE32_REVISION))
|
||||
VC_REV := $(shell cat EDUKE32_REVISION)
|
||||
endif
|
||||
endif
|
||||
ifeq (,$(VC_REV))
|
||||
VC_REV := $(shell svn info 2>&1 | grep Revision | cut -d' ' -f2)
|
||||
endif
|
||||
ifeq (,$(VC_REV))
|
||||
VC_REV := $(shell git svn info 2>&1 | grep Revision | cut -d' ' -f2)
|
||||
endif
|
||||
ifneq (,$(VC_REV)$(VC_REV_CUSTOM))
|
||||
REVFLAG += -DREV="\"r$(VC_REV)$(VC_REV_CUSTOM)\""
|
||||
endif
|
||||
|
||||
COMPILER=$(CC) $(CONLYFLAGS)
|
||||
LINKER=$(L_CC)
|
||||
ifneq ($(CPLUSPLUS),0)
|
||||
|
|
|
@ -62,7 +62,6 @@ $(DUKE3D_OBJ)/winbits.$o: $(DUKE3D_SRC)/winbits.c
|
|||
$(DUKE3D_OBJ)/osdfuncs.$o: $(DUKE3D_SRC)/names.h $(ENGINE_INC)/build.h $(ENGINE_INC)/osd.h
|
||||
$(DUKE3D_OBJ)/osdcmds.$o: $(DUKE3D_SRC)/osdcmds.c $(DUKE3D_INC)/osdcmds.h $(ENGINE_INC)/osd.h $(duke3d_h)
|
||||
$(DUKE3D_OBJ)/animvpx.$o: $(DUKE3D_SRC)/animvpx.c $(DUKE3D_SRC)/animvpx.h $(duke3d_h) $(ENGINE_INC)/glbuild.h
|
||||
$(DUKE3D_OBJ)/rev.$o: $(DUKE3D_SRC)/rev.h
|
||||
|
||||
$(DUKE3D_OBJ)/lunatic_game.$o: $(ENGINE_INC)/lunatic.h $(DUKE3D_SRC)/lunatic/lunatic_game.c $(DUKE3D_SRC)/lunatic/lunatic_game.h $(DUKE3D_SRC)/gamedef.h $(DUKE3D_SRC)/gameexec.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/osd.h
|
||||
$(DUKE3D_OBJ)/lunatic_m32.$o: $(ENGINE_INC)/lunatic.h $(DUKE3D_SRC)/lunatic/lunatic_m32.c $(DUKE3D_SRC)/lunatic/lunatic_m32.h $(ENGINE_INC)/cache1d.h $(ENGINE_INC)/osd.h
|
||||
|
|
|
@ -47,8 +47,14 @@ enum
|
|||
//// EXTERN DECLS
|
||||
extern struct strllist *CommandPaths, *CommandGrps;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern const char *s_buildRev;
|
||||
extern const char *s_buildTimestamp;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
extern const char *s_buildInfo;
|
||||
|
||||
//// FUNCTIONS
|
||||
|
|
|
@ -199,10 +199,7 @@ if [ -z "$rev" ]; then
|
|||
echo "Detected git repository, revision r$rev"
|
||||
fi
|
||||
|
||||
if [ -n "$rev" ]; then
|
||||
# throw the svn revision into a header. this is ugly.
|
||||
echo "s_buildRev = \"r$rev\";" > source/rev.h
|
||||
else
|
||||
if [ -z "$rev" ]; then
|
||||
rev=unknown
|
||||
vc=none
|
||||
fi
|
||||
|
@ -372,13 +369,6 @@ if [ $buildmain == 1 ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# clean up, clean up, everybody everywhere, clean up, clean up, everybody do your share
|
||||
if [ "$vc" == "svn" ]; then
|
||||
svn revert "source/rev.h"
|
||||
elif [ "$vc" == "git" ]; then
|
||||
git checkout "source/rev.h"
|
||||
fi
|
||||
|
||||
# Duplicating .app bundles for debug build:
|
||||
if [ $builddebug == 1 ] || [ $pack == 1 ]; then
|
||||
for i in Mapster32 EDuke32; do
|
||||
|
|
|
@ -13,7 +13,6 @@ if not "%rev%"=="" set vc=svn
|
|||
if "%rev%"=="" for /f "delims=" %%G in ('git svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=%%G
|
||||
if not "%rev%"=="" set vc=git
|
||||
if "%rev%"=="" set vc=none
|
||||
if not "%rev%"=="" echo s_buildRev = "r%rev%";>source\rev.h
|
||||
if "%rev%"=="" set rev=XXXX
|
||||
|
||||
:: Get the current date:
|
||||
|
@ -43,9 +42,5 @@ xcopy /e /q /y /EXCLUDE:%wiidir%\xcopy_exclude.txt package\sdk apps\mapster32\
|
|||
|
||||
:end
|
||||
|
||||
:: Clean up revision number:
|
||||
if "%vc%"=="svn" svn revert source\rev.h
|
||||
if "%vc%"=="git" git checkout source\rev.h
|
||||
|
||||
endlocal
|
||||
goto :eof
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
// 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.
|
||||
// This file's main purpose is to be recompiled unconditionally so the timestamp gets updated, even for a partial recompile.
|
||||
|
||||
const char *
|
||||
#include "rev.h"
|
||||
#if !defined REV
|
||||
# define REV "r(?)"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
const char* s_buildRev = REV;
|
||||
const char* s_buildTimestamp = __DATE__ " " __TIME__;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
s_buildRev = "rXXXX";
|
Loading…
Reference in a new issue