Added Git Version number (*NIX only)

This commit is contained in:
George Smart
2017-03-09 20:55:41 +00:00
parent 960e4d8d98
commit d3377e776c
9 changed files with 73 additions and 20 deletions

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@ MMDVMHost
*.VC.db *.VC.db
.vs .vs
*.ambe *.ambe
gitversion.h

View File

@@ -33,6 +33,7 @@
#include "LCDproc.h" #include "LCDproc.h"
#include "Thread.h" #include "Thread.h"
#include "Log.h" #include "Log.h"
#include "gitversion.h"
#if defined(HD44780) #if defined(HD44780)
#include "HD44780.h" #include "HD44780.h"
@@ -235,6 +236,7 @@ int CMMDVMHost::run()
LogInfo(HEADER4); LogInfo(HEADER4);
LogMessage("MMDVMHost-%s is starting", VERSION); LogMessage("MMDVMHost-%s is starting", VERSION);
LogMessage("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion);
readParams(); readParams();

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,11 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif

View File

@@ -15,12 +15,19 @@ OBJECTS = \
all: MMDVMHost all: MMDVMHost
MMDVMHost: $(OBJECTS) MMDVMHost: gitversion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
%.o: %.cpp %.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
clean: clean:
$(RM) MMDVMHost *.o *.d *.bak *~ $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h
# Export the current git version if the index file exists, else 000...
gitversion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif