From 4786d779b59569fff0833960c8d7ae47a43c40b3 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Wed, 11 Mar 2026 17:25:22 +0000 Subject: [PATCH] Improve the build process. --- .gitignore | 1 + Makefile | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bbd9216..d176dda 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ Release x64 DMRGateway *.o +*.d *.opendb *.bak *.obj diff --git a/Makefile b/Makefile index 3393386..da3cad0 100644 --- a/Makefile +++ b/Makefile @@ -2,27 +2,27 @@ CC = cc CXX = c++ # Use the following CFLAGS and LIBS if you don't want to use gpsd. -CFLAGS = -g -O3 -Wall -std=c++0x -pthread +CFLAGS = -g -O3 -Wall -std=c++0x -MMD -MD -pthread LIBS = -lpthread -lmosquitto # Use the following CFLAGS and LIBS if you do want to use gpsd. -#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread +#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -MMD -MD -pthread #LIBS = -lpthread -lgps -lmosquitto LDFLAGS = -g -OBJECTS = APRSWriter.o BPTC19696.o Conf.o CRC.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREmbeddedData.o DMREMB.o DMRFullLC.o DMRGateway.o \ - DMRLC.o DMRNetwork.o DMRSlotType.o DynVoice.o Golay2087.o GPSD.o Hamming.o Log.o MMDVMNetwork.o MQTTConnection.o PassAllPC.o \ - PassAllTG.o QR1676.o Reflectors.o RemoteControl.o Rewrite.o RewriteDstId.o RewriteDynTGNet.o RewriteDynTGRF.o RewritePC.o \ - RewriteSrc.o RewriteSrcId.o RewriteTG.o RewriteType.o RS129.o SHA256.o StopWatch.o Sync.o Thread.o Timer.o UDPSocket.o Utils.o XLXVoice.o +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) all: DMRGateway -DMRGateway: GitVersion.h $(OBJECTS) - $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o DMRGateway +DMRGateway: GitVersion.h $(OBJS) + $(CXX) $(OBJS) $(CFLAGS) $(LIBS) -o DMRGateway %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< +-include $(DEPS) DMRGateway.o: GitVersion.h FORCE