From ae02a91f9bb1d93b40d6dac8abc5e04c353c76d3 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 22 Apr 2024 14:15:44 +0100 Subject: [PATCH] Allow it to build under Linux again. --- NXDNGateway/Makefile | 19 +++++++++++++++++-- NXDNParrot/Makefile | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/NXDNGateway/Makefile b/NXDNGateway/Makefile index c989240..87f9b2a 100644 --- a/NXDNGateway/Makefile +++ b/NXDNGateway/Makefile @@ -16,15 +16,30 @@ OBJECTS = APRSWriter.o Conf.o GPSHandler.o IcomNetwork.o KenwoodNetwork.o Log.o all: NXDNGateway -NXDNGateway: $(OBJECTS) +NXDNGateway: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o NXDNGateway %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< +NXDNGateway.o: GitVersion.h FORCE + +.PHONY: GitVersion.h + +FORCE: + + install: install -m 755 NXDNGateway /usr/local/bin/ clean: $(RM) NXDNGateway *.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 + diff --git a/NXDNParrot/Makefile b/NXDNParrot/Makefile index e82bca0..7b8012b 100644 --- a/NXDNParrot/Makefile +++ b/NXDNParrot/Makefile @@ -8,14 +8,30 @@ OBJECTS = NXDNNetwork.o NXDNParrot.o Parrot.o StopWatch.o Thread.o Timer.o UDPSo all: NXDNParrot -NXDNParrot: $(OBJECTS) +NXDNParrot: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o NXDNParrot %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< +NXDNParrot.o: GitVersion.h FORCE + +.PHONY: GitVersion.h + +FORCE: + + install: install -m 755 NXDNParrot /usr/local/bin/ clean: $(RM) NXDNParrot *.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 +