mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-04 14:07:36 +00:00
Added Git Version number (*NIX only)
This commit is contained in:
parent
960e4d8d98
commit
d3377e776c
9 changed files with 73 additions and 20 deletions
13
Makefile
13
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue