mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Added Git Version number (*NIX only)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@ MMDVMHost
|
||||
*.VC.db
|
||||
.vs
|
||||
*.ambe
|
||||
gitversion.h
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "LCDproc.h"
|
||||
#include "Thread.h"
|
||||
#include "Log.h"
|
||||
#include "gitversion.h"
|
||||
|
||||
#if defined(HD44780)
|
||||
#include "HD44780.h"
|
||||
@@ -235,6 +236,7 @@ int CMMDVMHost::run()
|
||||
LogInfo(HEADER4);
|
||||
|
||||
LogMessage("MMDVMHost-%s is starting", VERSION);
|
||||
LogMessage("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion);
|
||||
|
||||
readParams();
|
||||
|
||||
|
||||
11
Makefile
11
Makefile
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
11
Makefile.Pi
11
Makefile.Pi
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
@@ -15,11 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
@@ -15,12 +15,19 @@ OBJECTS = \
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
MMDVMHost: gitversion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user