Adding initial support to display the git commit id in the simulator code.

This commit is contained in:
Mark Pizzolato 2012-12-20 15:04:37 -08:00
parent 9e421ada27
commit f8e68b70b5
3 changed files with 17 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,3 +1,4 @@
.git-commit-id
#ignore thumbnails created by windows #ignore thumbnails created by windows
Thumbs.db Thumbs.db
#Ignore files built by Visual Studio #Ignore files built by Visual Studio
@ -41,3 +42,4 @@ ipch/
Visual Studio Projects/* Visual Studio Projects/*

View file

@ -296,6 +296,9 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin)
ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi)) ifneq (binexists,$(shell if $(TEST) -e BIN; then echo binexists; fi))
MKDIRBIN = mkdir -p BIN MKDIRBIN = mkdir -p BIN
endif endif
ifneq (,$(shell cat .git-commit-id))
GIT_COMMIT_ID=$(shell cat .git-commit-id)
endif
else else
#Win32 Environments (via MinGW32) #Win32 Environments (via MinGW32)
GCC = gcc GCC = gcc
@ -338,7 +341,11 @@ else
ifneq ($(USE_NETWORK),) ifneq ($(USE_NETWORK),)
NETWORK_OPT += -DUSE_SHARED NETWORK_OPT += -DUSE_SHARED
endif 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)
endif endif
endif
CFLAGS_GIT = -DSIM_GIT_COMMIT_ID="$(GIT_COMMIT_ID)"
ifneq ($(DEBUG),) ifneq ($(DEBUG),)
CFLAGS_G = -g -ggdb -g3 CFLAGS_G = -g -ggdb -g3
CFLAGS_O = -O0 CFLAGS_O = -O0
@ -406,6 +413,10 @@ ifneq (clean,$(MAKECMDGOALS))
ifneq (,$(NETWORK_FEATURES)) ifneq (,$(NETWORK_FEATURES))
$(info *** $(NETWORK_FEATURES).) $(info *** $(NETWORK_FEATURES).)
endif endif
ifneq (,$(GIT_COMMIT_ID))
$(info ***)
$(info *** git commit id is $(GIT_COMMIT_ID).)
endif
$(info ***) $(info ***)
endif endif
ifneq ($(DONT_USE_ROMS),) ifneq ($(DONT_USE_ROMS),)
@ -419,7 +430,7 @@ endif
CC_STD = -std=c99 CC_STD = -std=c99
CC_OUTSPEC = -o $@ CC_OUTSPEC = -o $@
CC = $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) -I . $(OS_CCDEFS) $(ROMS_OPT) CC = $(GCC) $(CC_STD) -U__STRICT_ANSI__ $(CFLAGS_G) $(CFLAGS_O) $(CFLAGS_GIT) -I . $(OS_CCDEFS) $(ROMS_OPT)
LDFLAGS = $(OS_LDFLAGS) $(NETWORK_LDFLAGS) $(LDFLAGS_O) LDFLAGS = $(OS_LDFLAGS) $(NETWORK_LDFLAGS) $(LDFLAGS_O)
# #

3
scp.c
View file

@ -2298,6 +2298,9 @@ if (vdelt)
if (flag) if (flag)
fprintf (st, " [%s, %s, %s]", sim_si64, sim_sa64, sim_snet); fprintf (st, " [%s, %s, %s]", sim_si64, sim_sa64, sim_snet);
fprintf (st, "\n"); fprintf (st, "\n");
#if defined(SIM_GIT_COMMIT_ID)
fprintf (st, "git commit id: %8.8s\n", SIM_GIT_COMMIT_ID);
#endif
return SCPE_OK; return SCPE_OK;
} }