Added support to display git commit id when building from a zip archive and also to display the compiler version in SHOW VERSION on more platforms

This commit is contained in:
Mark Pizzolato 2013-04-15 09:31:54 -07:00
parent 8cb6a2ef79
commit b54504906f
2 changed files with 12 additions and 2 deletions

View file

@ -373,8 +373,12 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))
MKDIRBIN = mkdir -p BIN
endif
ifneq (,$(shell if $(TEST) -e .git-commit-id; then echo commit-id-exists; fi))
ifeq (commit-id-exists,$(shell if $(TEST) -e .git-commit-id; then echo commit-id-exists; fi))
GIT_COMMIT_ID=$(shell cat .git-commit-id)
else
ifeq (,$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | grep 'Format:'))
GIT_COMMIT_ID=$(shell grep 'define SIM_GIT_COMMIT_ID' sim_rev.h | awk '{ print $$3 }')
endif
endif
else
#Win32 Environments (via MinGW32)
@ -424,6 +428,10 @@ else
endif
ifneq (,$(shell if exist .git-commit-id type .git-commit-id))
GIT_COMMIT_ID=$(shell if exist .git-commit-id type .git-commit-id)
else
ifeq (,$(shell findstr /C:"define SIM_GIT_COMMIT_ID" sim_rev.h | findstr Format))
GIT_COMMIT_ID=$(shell for /F "tokens=3" %%i in ("$(shell findstr /C:"define SIM_GIT_COMMIT_ID" sim_rev.h)") do echo %%i)
endif
endif
endif
ifneq (,$(GIT_COMMIT_ID))
@ -519,7 +527,7 @@ else
endif
endif
CC_OUTSPEC = -o $@
CC = $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) $(CFLAGS_GIT) -I . $(OS_CCDEFS) $(ROMS_OPT)
CC = $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) $(CFLAGS_GIT) -DSIM_COMPILER="$(COMPILER_NAME)" -I . $(OS_CCDEFS) $(ROMS_OPT)
LDFLAGS = $(OS_LDFLAGS) $(NETWORK_LDFLAGS) $(LDFLAGS_O)
#

2
scp.c
View file

@ -2788,6 +2788,8 @@ if (flag) {
fprintf (st, "\n\t\tCompiler: Microsoft Visual C++ %d.%02d.%05d.%02d", _MSC_FULL_VER/10000000, (_MSC_FULL_VER/100000)%100, _MSC_FULL_VER%100000, _MSC_BUILD);
#elif defined (__DECC_VER)
fprintf (st, "\n\t\tCompiler: DEC C %c%d.%d-%03d", ("T SV")[((__DECC_VER/10000)%10)-6], __DECC_VER/10000000, (__DECC_VER/100000)%100, __DECC_VER%10000);
#elif defined (SIM_COMPILER)
fprintf (st, "\n\t\tCompiler: %s", SIM_COMPILER);
#endif
#if defined (__DATE__) && defined (__TIME__)
fprintf (st, "\n\t\tSimulator Compiled: %s at %s", __DATE__, __TIME__);