mirror of
https://github.com/g4klx/DAPNETGateway.git
synced 2026-08-26 12:32:45 -04:00
Add the gitversion to the Makefile.
This commit is contained in:
parent
bbc1a30c5d
commit
bb3463b14c
1 changed files with 17 additions and 1 deletions
18
Makefile
18
Makefile
|
|
@ -8,14 +8,30 @@ OBJECTS = Conf.o DAPNETGateway.o DAPNETNetwork.o Log.o POCSAGMessage.o POCSAGNet
|
|||
|
||||
all: DAPNETGateway
|
||||
|
||||
DAPNETGateway: $(OBJECTS)
|
||||
DAPNETGateway: GitVersion.h $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o DAPNETGateway
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
DAPNETGateway.o: GitVersion.h FORCE
|
||||
|
||||
.PHONY: GitVersion.h
|
||||
|
||||
FORCE:
|
||||
|
||||
|
||||
install:
|
||||
install -m 755 DAPNETGateway /usr/local/bin/
|
||||
|
||||
clean:
|
||||
$(RM) DAPNETGateway *.o *.d *.bak *~
|
||||
|
||||
# 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