Allow it to build under Linux again.

This commit is contained in:
Jonathan Naylor 2024-04-22 14:15:44 +01:00
parent 0c22c2d2de
commit ae02a91f9b
2 changed files with 34 additions and 3 deletions

View File

@ -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

View File

@ -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