mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-24 09:35:40 +08:00
Added Git Version number (*NIX only)
This commit is contained in:
@@ -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