diff --git a/.circleci/config.yml b/.circleci/config.yml index 0502fb1..4e8c1d4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,14 +20,11 @@ jobs: sudo apt-get update sudo apt-get -y install libgtest-dev libcurl4-openssl-dev libboost-dev libgps-dev - run: - name: "Build App" - command: "make -j 3 dstargateway USE_GPSD=1" - - run: - name: "Build Tests" - command: "make -j 3 tests USE_GPSD=1" + name: "Build" + command: "make -j 3 ENABLE_DEBUG=1 USE_GPSD=1" - run: name: "Run Tests" - command: "make run-tests USE_GPSD=1" + command: "make run-tests" # Invoke jobs via workflows # See: https://circleci.com/docs/2.0/configuration-reference/#workflows workflows: diff --git a/APRSCollector.cpp b/Common/APRSCollector.cpp similarity index 100% rename from APRSCollector.cpp rename to Common/APRSCollector.cpp diff --git a/APRSCollector.h b/Common/APRSCollector.h similarity index 100% rename from APRSCollector.h rename to Common/APRSCollector.h diff --git a/APRSEntry.cpp b/Common/APRSEntry.cpp similarity index 100% rename from APRSEntry.cpp rename to Common/APRSEntry.cpp diff --git a/APRSEntry.h b/Common/APRSEntry.h similarity index 100% rename from APRSEntry.h rename to Common/APRSEntry.h diff --git a/APRSEntryStatus.cpp b/Common/APRSEntryStatus.cpp similarity index 100% rename from APRSEntryStatus.cpp rename to Common/APRSEntryStatus.cpp diff --git a/APRSEntryStatus.h b/Common/APRSEntryStatus.h similarity index 100% rename from APRSEntryStatus.h rename to Common/APRSEntryStatus.h diff --git a/APRSFixedIdFrameProvider.cpp b/Common/APRSFixedIdFrameProvider.cpp similarity index 100% rename from APRSFixedIdFrameProvider.cpp rename to Common/APRSFixedIdFrameProvider.cpp diff --git a/APRSFixedIdFrameProvider.h b/Common/APRSFixedIdFrameProvider.h similarity index 100% rename from APRSFixedIdFrameProvider.h rename to Common/APRSFixedIdFrameProvider.h diff --git a/APRSGPSDIdFrameProvider.cpp b/Common/APRSGPSDIdFrameProvider.cpp similarity index 100% rename from APRSGPSDIdFrameProvider.cpp rename to Common/APRSGPSDIdFrameProvider.cpp diff --git a/APRSGPSDIdFrameProvider.h b/Common/APRSGPSDIdFrameProvider.h similarity index 100% rename from APRSGPSDIdFrameProvider.h rename to Common/APRSGPSDIdFrameProvider.h diff --git a/APRSHandler.cpp b/Common/APRSHandler.cpp similarity index 100% rename from APRSHandler.cpp rename to Common/APRSHandler.cpp diff --git a/APRSHandler.h b/Common/APRSHandler.h similarity index 100% rename from APRSHandler.h rename to Common/APRSHandler.h diff --git a/APRSHandlerThread.cpp b/Common/APRSHandlerThread.cpp similarity index 100% rename from APRSHandlerThread.cpp rename to Common/APRSHandlerThread.cpp diff --git a/APRSHandlerThread.h b/Common/APRSHandlerThread.h similarity index 100% rename from APRSHandlerThread.h rename to Common/APRSHandlerThread.h diff --git a/APRSIdFrameProvider.cpp b/Common/APRSIdFrameProvider.cpp similarity index 100% rename from APRSIdFrameProvider.cpp rename to Common/APRSIdFrameProvider.cpp diff --git a/APRSIdFrameProvider.h b/Common/APRSIdFrameProvider.h similarity index 100% rename from APRSIdFrameProvider.h rename to Common/APRSIdFrameProvider.h diff --git a/APRSUnit.cpp b/Common/APRSUnit.cpp similarity index 100% rename from APRSUnit.cpp rename to Common/APRSUnit.cpp diff --git a/APRSUnit.h b/Common/APRSUnit.h similarity index 100% rename from APRSUnit.h rename to Common/APRSUnit.h diff --git a/APRStoDPRS.cpp b/Common/APRStoDPRS.cpp similarity index 100% rename from APRStoDPRS.cpp rename to Common/APRStoDPRS.cpp diff --git a/APRStoDPRS.h b/Common/APRStoDPRS.h similarity index 100% rename from APRStoDPRS.h rename to Common/APRStoDPRS.h diff --git a/AnnouncementUnit.cpp b/Common/AnnouncementUnit.cpp similarity index 100% rename from AnnouncementUnit.cpp rename to Common/AnnouncementUnit.cpp diff --git a/AnnouncementUnit.h b/Common/AnnouncementUnit.h similarity index 100% rename from AnnouncementUnit.h rename to Common/AnnouncementUnit.h diff --git a/AudioUnit.cpp b/Common/AudioUnit.cpp similarity index 100% rename from AudioUnit.cpp rename to Common/AudioUnit.cpp diff --git a/AudioUnit.h b/Common/AudioUnit.h similarity index 100% rename from AudioUnit.h rename to Common/AudioUnit.h diff --git a/CCSCallback.h b/Common/CCSCallback.h similarity index 100% rename from CCSCallback.h rename to Common/CCSCallback.h diff --git a/CCSData.cpp b/Common/CCSData.cpp similarity index 100% rename from CCSData.cpp rename to Common/CCSData.cpp diff --git a/CCSData.h b/Common/CCSData.h similarity index 100% rename from CCSData.h rename to Common/CCSData.h diff --git a/CCSProtocolHandler.cpp b/Common/CCSProtocolHandler.cpp similarity index 100% rename from CCSProtocolHandler.cpp rename to Common/CCSProtocolHandler.cpp diff --git a/CCSProtocolHandler.h b/Common/CCSProtocolHandler.h similarity index 100% rename from CCSProtocolHandler.h rename to Common/CCSProtocolHandler.h diff --git a/CacheManager.cpp b/Common/CacheManager.cpp similarity index 100% rename from CacheManager.cpp rename to Common/CacheManager.cpp diff --git a/CacheManager.h b/Common/CacheManager.h similarity index 100% rename from CacheManager.h rename to Common/CacheManager.h diff --git a/ConnectData.cpp b/Common/ConnectData.cpp similarity index 100% rename from ConnectData.cpp rename to Common/ConnectData.cpp diff --git a/ConnectData.h b/Common/ConnectData.h similarity index 100% rename from ConnectData.h rename to Common/ConnectData.h diff --git a/DCSHandler.cpp b/Common/DCSHandler.cpp similarity index 100% rename from DCSHandler.cpp rename to Common/DCSHandler.cpp diff --git a/DCSHandler.h b/Common/DCSHandler.h similarity index 100% rename from DCSHandler.h rename to Common/DCSHandler.h diff --git a/DCSProtocolHandler.cpp b/Common/DCSProtocolHandler.cpp similarity index 100% rename from DCSProtocolHandler.cpp rename to Common/DCSProtocolHandler.cpp diff --git a/DCSProtocolHandler.h b/Common/DCSProtocolHandler.h similarity index 100% rename from DCSProtocolHandler.h rename to Common/DCSProtocolHandler.h diff --git a/DCSProtocolHandlerPool.cpp b/Common/DCSProtocolHandlerPool.cpp similarity index 100% rename from DCSProtocolHandlerPool.cpp rename to Common/DCSProtocolHandlerPool.cpp diff --git a/DCSProtocolHandlerPool.h b/Common/DCSProtocolHandlerPool.h similarity index 100% rename from DCSProtocolHandlerPool.h rename to Common/DCSProtocolHandlerPool.h diff --git a/DDHandler.cpp b/Common/DDHandler.cpp similarity index 100% rename from DDHandler.cpp rename to Common/DDHandler.cpp diff --git a/DDHandler.h b/Common/DDHandler.h similarity index 100% rename from DDHandler.h rename to Common/DDHandler.h diff --git a/DExtraHandler.cpp b/Common/DExtraHandler.cpp similarity index 100% rename from DExtraHandler.cpp rename to Common/DExtraHandler.cpp diff --git a/DExtraHandler.h b/Common/DExtraHandler.h similarity index 100% rename from DExtraHandler.h rename to Common/DExtraHandler.h diff --git a/DExtraProtocolHandler.cpp b/Common/DExtraProtocolHandler.cpp similarity index 100% rename from DExtraProtocolHandler.cpp rename to Common/DExtraProtocolHandler.cpp diff --git a/DExtraProtocolHandler.h b/Common/DExtraProtocolHandler.h similarity index 100% rename from DExtraProtocolHandler.h rename to Common/DExtraProtocolHandler.h diff --git a/DExtraProtocolHandlerPool.cpp b/Common/DExtraProtocolHandlerPool.cpp similarity index 100% rename from DExtraProtocolHandlerPool.cpp rename to Common/DExtraProtocolHandlerPool.cpp diff --git a/DExtraProtocolHandlerPool.h b/Common/DExtraProtocolHandlerPool.h similarity index 100% rename from DExtraProtocolHandlerPool.h rename to Common/DExtraProtocolHandlerPool.h diff --git a/DPlusAuthenticator.cpp b/Common/DPlusAuthenticator.cpp similarity index 100% rename from DPlusAuthenticator.cpp rename to Common/DPlusAuthenticator.cpp diff --git a/DPlusAuthenticator.h b/Common/DPlusAuthenticator.h similarity index 100% rename from DPlusAuthenticator.h rename to Common/DPlusAuthenticator.h diff --git a/DPlusHandler.cpp b/Common/DPlusHandler.cpp similarity index 100% rename from DPlusHandler.cpp rename to Common/DPlusHandler.cpp diff --git a/DPlusHandler.h b/Common/DPlusHandler.h similarity index 100% rename from DPlusHandler.h rename to Common/DPlusHandler.h diff --git a/DPlusProtocolHandler.cpp b/Common/DPlusProtocolHandler.cpp similarity index 100% rename from DPlusProtocolHandler.cpp rename to Common/DPlusProtocolHandler.cpp diff --git a/DPlusProtocolHandler.h b/Common/DPlusProtocolHandler.h similarity index 100% rename from DPlusProtocolHandler.h rename to Common/DPlusProtocolHandler.h diff --git a/DPlusProtocolHandlerPool.cpp b/Common/DPlusProtocolHandlerPool.cpp similarity index 100% rename from DPlusProtocolHandlerPool.cpp rename to Common/DPlusProtocolHandlerPool.cpp diff --git a/DPlusProtocolHandlerPool.h b/Common/DPlusProtocolHandlerPool.h similarity index 100% rename from DPlusProtocolHandlerPool.h rename to Common/DPlusProtocolHandlerPool.h diff --git a/Defs.h b/Common/Defs.h similarity index 100% rename from Defs.h rename to Common/Defs.h diff --git a/DummyRepeaterProtocolHandler.cpp b/Common/DummyRepeaterProtocolHandler.cpp similarity index 100% rename from DummyRepeaterProtocolHandler.cpp rename to Common/DummyRepeaterProtocolHandler.cpp diff --git a/DummyRepeaterProtocolHandler.h b/Common/DummyRepeaterProtocolHandler.h similarity index 100% rename from DummyRepeaterProtocolHandler.h rename to Common/DummyRepeaterProtocolHandler.h diff --git a/EchoUnit.cpp b/Common/EchoUnit.cpp similarity index 100% rename from EchoUnit.cpp rename to Common/EchoUnit.cpp diff --git a/EchoUnit.h b/Common/EchoUnit.h similarity index 100% rename from EchoUnit.h rename to Common/EchoUnit.h diff --git a/G2Handler.cpp b/Common/G2Handler.cpp similarity index 100% rename from G2Handler.cpp rename to Common/G2Handler.cpp diff --git a/G2Handler.h b/Common/G2Handler.h similarity index 100% rename from G2Handler.h rename to Common/G2Handler.h diff --git a/G2ProtocolHandler.cpp b/Common/G2ProtocolHandler.cpp similarity index 100% rename from G2ProtocolHandler.cpp rename to Common/G2ProtocolHandler.cpp diff --git a/G2ProtocolHandler.h b/Common/G2ProtocolHandler.h similarity index 100% rename from G2ProtocolHandler.h rename to Common/G2ProtocolHandler.h diff --git a/G2ProtocolHandlerPool.cpp b/Common/G2ProtocolHandlerPool.cpp similarity index 100% rename from G2ProtocolHandlerPool.cpp rename to Common/G2ProtocolHandlerPool.cpp diff --git a/G2ProtocolHandlerPool.h b/Common/G2ProtocolHandlerPool.h similarity index 100% rename from G2ProtocolHandlerPool.h rename to Common/G2ProtocolHandlerPool.h diff --git a/GPSACollector.cpp b/Common/GPSACollector.cpp similarity index 100% rename from GPSACollector.cpp rename to Common/GPSACollector.cpp diff --git a/GPSACollector.h b/Common/GPSACollector.h similarity index 100% rename from GPSACollector.h rename to Common/GPSACollector.h diff --git a/GatewayCache.cpp b/Common/GatewayCache.cpp similarity index 100% rename from GatewayCache.cpp rename to Common/GatewayCache.cpp diff --git a/GatewayCache.h b/Common/GatewayCache.h similarity index 100% rename from GatewayCache.h rename to Common/GatewayCache.h diff --git a/HBRepeaterProtocolHandler.cpp b/Common/HBRepeaterProtocolHandler.cpp similarity index 100% rename from HBRepeaterProtocolHandler.cpp rename to Common/HBRepeaterProtocolHandler.cpp diff --git a/HBRepeaterProtocolHandler.h b/Common/HBRepeaterProtocolHandler.h similarity index 100% rename from HBRepeaterProtocolHandler.h rename to Common/HBRepeaterProtocolHandler.h diff --git a/HeaderLogger.cpp b/Common/HeaderLogger.cpp similarity index 100% rename from HeaderLogger.cpp rename to Common/HeaderLogger.cpp diff --git a/HeaderLogger.h b/Common/HeaderLogger.h similarity index 100% rename from HeaderLogger.h rename to Common/HeaderLogger.h diff --git a/HeardData.cpp b/Common/HeardData.cpp similarity index 100% rename from HeardData.cpp rename to Common/HeardData.cpp diff --git a/HeardData.h b/Common/HeardData.h similarity index 100% rename from HeardData.h rename to Common/HeardData.h diff --git a/IcomRepeaterProtocolHandler.cpp b/Common/IcomRepeaterProtocolHandler.cpp similarity index 100% rename from IcomRepeaterProtocolHandler.cpp rename to Common/IcomRepeaterProtocolHandler.cpp diff --git a/IcomRepeaterProtocolHandler.h b/Common/IcomRepeaterProtocolHandler.h similarity index 100% rename from IcomRepeaterProtocolHandler.h rename to Common/IcomRepeaterProtocolHandler.h diff --git a/Common/Makefile b/Common/Makefile new file mode 100644 index 0000000..f04541f --- /dev/null +++ b/Common/Makefile @@ -0,0 +1,19 @@ +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) + +Common.a: $(OBJS) ../APRS/APRS.a ../BaseCommon/BaseCommon.a ../DStarBase/DStarBase.a ../IRCDDB/IRCDDB.a ../VersionInfo/GitVersion.h + $(AR) rcs Common.a $(OBJS) + +%.o : %.cpp + $(CC) -I../APRS -I../BaseCommon -I../DStarBase -I../IRCDDB -I../VersionInfo $(CPPFLAGS) -MMD -MD -c $< -o $@ + +.PHONY clean: +clean: + $(RM) *.o *.d Common.a + +../APRS/APRS.a: +../BaseCommon/BaseCommon.a: +../DStarBase/DStarBase.a: +../IRCDDB/IRCDDB.a: +../VersionInfo/GitVersion.h: diff --git a/NMEASentenceCollector.cpp b/Common/NMEASentenceCollector.cpp similarity index 100% rename from NMEASentenceCollector.cpp rename to Common/NMEASentenceCollector.cpp diff --git a/NMEASentenceCollector.h b/Common/NMEASentenceCollector.h similarity index 100% rename from NMEASentenceCollector.h rename to Common/NMEASentenceCollector.h diff --git a/PollData.cpp b/Common/PollData.cpp similarity index 100% rename from PollData.cpp rename to Common/PollData.cpp diff --git a/PollData.h b/Common/PollData.h similarity index 100% rename from PollData.h rename to Common/PollData.h diff --git a/RSMS1AMessageBuilder.cpp b/Common/RSMS1AMessageBuilder.cpp similarity index 100% rename from RSMS1AMessageBuilder.cpp rename to Common/RSMS1AMessageBuilder.cpp diff --git a/RSMS1AMessageBuilder.h b/Common/RSMS1AMessageBuilder.h similarity index 100% rename from RSMS1AMessageBuilder.h rename to Common/RSMS1AMessageBuilder.h diff --git a/RSMS1AMessageCollector.cpp b/Common/RSMS1AMessageCollector.cpp similarity index 100% rename from RSMS1AMessageCollector.cpp rename to Common/RSMS1AMessageCollector.cpp diff --git a/RSMS1AMessageCollector.h b/Common/RSMS1AMessageCollector.h similarity index 100% rename from RSMS1AMessageCollector.h rename to Common/RSMS1AMessageCollector.h diff --git a/ReadAPRSFrameCallback.h b/Common/ReadAPRSFrameCallback.h similarity index 100% rename from ReadAPRSFrameCallback.h rename to Common/ReadAPRSFrameCallback.h diff --git a/ReflectorCallback.h b/Common/ReflectorCallback.h similarity index 100% rename from ReflectorCallback.h rename to Common/ReflectorCallback.h diff --git a/RemoteHandler.cpp b/Common/RemoteHandler.cpp similarity index 100% rename from RemoteHandler.cpp rename to Common/RemoteHandler.cpp diff --git a/RemoteHandler.h b/Common/RemoteHandler.h similarity index 100% rename from RemoteHandler.h rename to Common/RemoteHandler.h diff --git a/RemoteLinkData.cpp b/Common/RemoteLinkData.cpp similarity index 100% rename from RemoteLinkData.cpp rename to Common/RemoteLinkData.cpp diff --git a/RemoteLinkData.h b/Common/RemoteLinkData.h similarity index 100% rename from RemoteLinkData.h rename to Common/RemoteLinkData.h diff --git a/RemoteProtocolHandler.cpp b/Common/RemoteProtocolHandler.cpp similarity index 100% rename from RemoteProtocolHandler.cpp rename to Common/RemoteProtocolHandler.cpp diff --git a/RemoteProtocolHandler.h b/Common/RemoteProtocolHandler.h similarity index 100% rename from RemoteProtocolHandler.h rename to Common/RemoteProtocolHandler.h diff --git a/RemoteRepeaterData.cpp b/Common/RemoteRepeaterData.cpp similarity index 100% rename from RemoteRepeaterData.cpp rename to Common/RemoteRepeaterData.cpp diff --git a/RemoteRepeaterData.h b/Common/RemoteRepeaterData.h similarity index 100% rename from RemoteRepeaterData.h rename to Common/RemoteRepeaterData.h diff --git a/RemoteUser.cpp b/Common/RemoteUser.cpp similarity index 100% rename from RemoteUser.cpp rename to Common/RemoteUser.cpp diff --git a/RemoteUser.h b/Common/RemoteUser.h similarity index 100% rename from RemoteUser.h rename to Common/RemoteUser.h diff --git a/RepeaterCache.cpp b/Common/RepeaterCache.cpp similarity index 100% rename from RepeaterCache.cpp rename to Common/RepeaterCache.cpp diff --git a/RepeaterCache.h b/Common/RepeaterCache.h similarity index 100% rename from RepeaterCache.h rename to Common/RepeaterCache.h diff --git a/RepeaterCallback.h b/Common/RepeaterCallback.h similarity index 100% rename from RepeaterCallback.h rename to Common/RepeaterCallback.h diff --git a/RepeaterHandler.cpp b/Common/RepeaterHandler.cpp similarity index 100% rename from RepeaterHandler.cpp rename to Common/RepeaterHandler.cpp diff --git a/RepeaterHandler.h b/Common/RepeaterHandler.h similarity index 100% rename from RepeaterHandler.h rename to Common/RepeaterHandler.h diff --git a/RepeaterProtocolHandler.h b/Common/RepeaterProtocolHandler.h similarity index 100% rename from RepeaterProtocolHandler.h rename to Common/RepeaterProtocolHandler.h diff --git a/SentenceCollector.cpp b/Common/SentenceCollector.cpp similarity index 100% rename from SentenceCollector.cpp rename to Common/SentenceCollector.cpp diff --git a/SentenceCollector.h b/Common/SentenceCollector.h similarity index 100% rename from SentenceCollector.h rename to Common/SentenceCollector.h diff --git a/SlowDataCollector.cpp b/Common/SlowDataCollector.cpp similarity index 100% rename from SlowDataCollector.cpp rename to Common/SlowDataCollector.cpp diff --git a/SlowDataCollector.h b/Common/SlowDataCollector.h similarity index 100% rename from SlowDataCollector.h rename to Common/SlowDataCollector.h diff --git a/SlowDataCollectorThrottle.cpp b/Common/SlowDataCollectorThrottle.cpp similarity index 100% rename from SlowDataCollectorThrottle.cpp rename to Common/SlowDataCollectorThrottle.cpp diff --git a/SlowDataCollectorThrottle.h b/Common/SlowDataCollectorThrottle.h similarity index 100% rename from SlowDataCollectorThrottle.h rename to Common/SlowDataCollectorThrottle.h diff --git a/SlowDataEncoder.cpp b/Common/SlowDataEncoder.cpp similarity index 100% rename from SlowDataEncoder.cpp rename to Common/SlowDataEncoder.cpp diff --git a/SlowDataEncoder.h b/Common/SlowDataEncoder.h similarity index 100% rename from SlowDataEncoder.h rename to Common/SlowDataEncoder.h diff --git a/StatusData.cpp b/Common/StatusData.cpp similarity index 100% rename from StatusData.cpp rename to Common/StatusData.cpp diff --git a/StatusData.h b/Common/StatusData.h similarity index 100% rename from StatusData.h rename to Common/StatusData.h diff --git a/TextCollector.cpp b/Common/TextCollector.cpp similarity index 100% rename from TextCollector.cpp rename to Common/TextCollector.cpp diff --git a/TextCollector.h b/Common/TextCollector.h similarity index 100% rename from TextCollector.h rename to Common/TextCollector.h diff --git a/TextData.cpp b/Common/TextData.cpp similarity index 100% rename from TextData.cpp rename to Common/TextData.cpp diff --git a/TextData.h b/Common/TextData.h similarity index 100% rename from TextData.h rename to Common/TextData.h diff --git a/UserCache.cpp b/Common/UserCache.cpp similarity index 100% rename from UserCache.cpp rename to Common/UserCache.cpp diff --git a/UserCache.h b/Common/UserCache.h similarity index 100% rename from UserCache.h rename to Common/UserCache.h diff --git a/VersionUnit.cpp b/Common/VersionUnit.cpp similarity index 100% rename from VersionUnit.cpp rename to Common/VersionUnit.cpp diff --git a/VersionUnit.h b/Common/VersionUnit.h similarity index 100% rename from VersionUnit.h rename to Common/VersionUnit.h diff --git a/XLXHostsFileDownloader.cpp b/Common/XLXHostsFileDownloader.cpp similarity index 100% rename from XLXHostsFileDownloader.cpp rename to Common/XLXHostsFileDownloader.cpp diff --git a/XLXHostsFileDownloader.h b/Common/XLXHostsFileDownloader.h similarity index 100% rename from XLXHostsFileDownloader.h rename to Common/XLXHostsFileDownloader.h diff --git a/example.cfg b/Common/example.cfg similarity index 100% rename from example.cfg rename to Common/example.cfg diff --git a/AMBEData.cpp b/DStarBase/AMBEData.cpp similarity index 100% rename from AMBEData.cpp rename to DStarBase/AMBEData.cpp diff --git a/AMBEData.h b/DStarBase/AMBEData.h similarity index 100% rename from AMBEData.h rename to DStarBase/AMBEData.h diff --git a/CallsignList.cpp b/DStarBase/CallsignList.cpp similarity index 100% rename from CallsignList.cpp rename to DStarBase/CallsignList.cpp diff --git a/CallsignList.h b/DStarBase/CallsignList.h similarity index 100% rename from CallsignList.h rename to DStarBase/CallsignList.h diff --git a/DDData.cpp b/DStarBase/DDData.cpp similarity index 100% rename from DDData.cpp rename to DStarBase/DDData.cpp diff --git a/DDData.h b/DStarBase/DDData.h similarity index 100% rename from DDData.h rename to DStarBase/DDData.h diff --git a/DStarDefines.h b/DStarBase/DStarDefines.h similarity index 100% rename from DStarDefines.h rename to DStarBase/DStarDefines.h diff --git a/DTMF.cpp b/DStarBase/DTMF.cpp similarity index 100% rename from DTMF.cpp rename to DStarBase/DTMF.cpp diff --git a/DTMF.h b/DStarBase/DTMF.h similarity index 100% rename from DTMF.h rename to DStarBase/DTMF.h diff --git a/DVTOOLFileReader.cpp b/DStarBase/DVTOOLFileReader.cpp similarity index 100% rename from DVTOOLFileReader.cpp rename to DStarBase/DVTOOLFileReader.cpp diff --git a/DVTOOLFileReader.h b/DStarBase/DVTOOLFileReader.h similarity index 100% rename from DVTOOLFileReader.h rename to DStarBase/DVTOOLFileReader.h diff --git a/HeaderData.cpp b/DStarBase/HeaderData.cpp similarity index 100% rename from HeaderData.cpp rename to DStarBase/HeaderData.cpp diff --git a/HeaderData.h b/DStarBase/HeaderData.h similarity index 100% rename from HeaderData.h rename to DStarBase/HeaderData.h diff --git a/HostFile.cpp b/DStarBase/HostFile.cpp similarity index 100% rename from HostFile.cpp rename to DStarBase/HostFile.cpp diff --git a/HostFile.h b/DStarBase/HostFile.h similarity index 100% rename from HostFile.h rename to DStarBase/HostFile.h diff --git a/DStarBase/Makefile b/DStarBase/Makefile new file mode 100644 index 0000000..c6e019d --- /dev/null +++ b/DStarBase/Makefile @@ -0,0 +1,14 @@ +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) + +DStarBase.a: $(OBJS) + $(AR) rcs DStarBase.a $(OBJS) + +%.o : %.cpp + $(CC) -I../BaseCommon $(CPPFLAGS) -MMD -MD -c $< -o $@ + +clean: + $(RM) *.o *.d DStarBase.a + +../BaseCommon/BaseCommon.a: diff --git a/DStarGatewayApp.cpp b/DStarGateway/DStarGatewayApp.cpp similarity index 100% rename from DStarGatewayApp.cpp rename to DStarGateway/DStarGatewayApp.cpp diff --git a/DStarGatewayApp.h b/DStarGateway/DStarGatewayApp.h similarity index 100% rename from DStarGatewayApp.h rename to DStarGateway/DStarGatewayApp.h diff --git a/DStarGatewayConfig.cpp b/DStarGateway/DStarGatewayConfig.cpp similarity index 100% rename from DStarGatewayConfig.cpp rename to DStarGateway/DStarGatewayConfig.cpp diff --git a/DStarGatewayConfig.h b/DStarGateway/DStarGatewayConfig.h similarity index 100% rename from DStarGatewayConfig.h rename to DStarGateway/DStarGatewayConfig.h diff --git a/DStarGatewayDefs.h b/DStarGateway/DStarGatewayDefs.h similarity index 100% rename from DStarGatewayDefs.h rename to DStarGateway/DStarGatewayDefs.h diff --git a/DStarGatewayStatusData.cpp b/DStarGateway/DStarGatewayStatusData.cpp similarity index 100% rename from DStarGatewayStatusData.cpp rename to DStarGateway/DStarGatewayStatusData.cpp diff --git a/DStarGatewayStatusData.h b/DStarGateway/DStarGatewayStatusData.h similarity index 100% rename from DStarGatewayStatusData.h rename to DStarGateway/DStarGatewayStatusData.h diff --git a/DStarGatewayThread.cpp b/DStarGateway/DStarGatewayThread.cpp similarity index 100% rename from DStarGatewayThread.cpp rename to DStarGateway/DStarGatewayThread.cpp diff --git a/DStarGatewayThread.h b/DStarGateway/DStarGatewayThread.h similarity index 100% rename from DStarGatewayThread.h rename to DStarGateway/DStarGatewayThread.h diff --git a/DStarGateway/Makefile b/DStarGateway/Makefile new file mode 100644 index 0000000..e7afbaf --- /dev/null +++ b/DStarGateway/Makefile @@ -0,0 +1,30 @@ +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) + +dstargateway: ../VersionInfo/GitVersion.h $(OBJS) ../APRS/APRS.a ../IRCDDB/IRCDDB.a ../DStarBase/DStarBase.a ../BaseCommon/BaseCommon.a ../Common/Common.a + $(CC) $(CPPFLAGS) -o dstargateway $(OBJS) ../Common/Common.a ../APRS/APRS.a ../DStarBase/DStarBase.a ../IRCDDB/IRCDDB.a ../BaseCommon/BaseCommon.a $(LDFLAGS) + +%.o : %.cpp + $(CC) -I../APRS -I../Common -I../BaseCommon -I../DStarBase -I../IRCDDB -I../VersionInfo $(CPPFLAGS) -MMD -MD -c $< -o $@ + +.PHONY clean: +clean: + $(RM) *.o *.d Common.a + +.PHONY install: +install: dstargateway +# copy executable + @cp -f dstargateway $(BIN_DIR + +# copy and adjust config + @cp -fn example.cfg $(CFG_DIR)/dstargateway.cfg + @sed -i "s|path=/var/log/dstargateway/|path=$(LOG_DIR)|g" $(CFG_DIR)/dstargateway.cfg + @sed -i "s|data=/usr/local/share/dstargateway.d/|data=$(DATA_DIR)|g" $(CFG_DIR)/dstargateway.cfg + +../APRS/APRS.a: +../Common/Common.a: +../DStarBase/DStarBase.a: +../BaseCommon/BaseCommon.a: +../IRCDDB/IRCDDB.a: +../VersionInfo/GitVersion.h: diff --git a/RepeaterProtocolHandlerFactory.cpp b/DStarGateway/RepeaterProtocolHandlerFactory.cpp similarity index 100% rename from RepeaterProtocolHandlerFactory.cpp rename to DStarGateway/RepeaterProtocolHandlerFactory.cpp diff --git a/RepeaterProtocolHandlerFactory.h b/DStarGateway/RepeaterProtocolHandlerFactory.h similarity index 100% rename from RepeaterProtocolHandlerFactory.h rename to DStarGateway/RepeaterProtocolHandlerFactory.h diff --git a/IRCApplication.h b/IRCDDB/IRCApplication.h similarity index 100% rename from IRCApplication.h rename to IRCDDB/IRCApplication.h diff --git a/IRCClient.cpp b/IRCDDB/IRCClient.cpp similarity index 100% rename from IRCClient.cpp rename to IRCDDB/IRCClient.cpp diff --git a/IRCClient.h b/IRCDDB/IRCClient.h similarity index 100% rename from IRCClient.h rename to IRCDDB/IRCClient.h diff --git a/IRCDDB.cpp b/IRCDDB/IRCDDB.cpp similarity index 100% rename from IRCDDB.cpp rename to IRCDDB/IRCDDB.cpp diff --git a/IRCDDB.h b/IRCDDB/IRCDDB.h similarity index 100% rename from IRCDDB.h rename to IRCDDB/IRCDDB.h diff --git a/IRCDDBApp.cpp b/IRCDDB/IRCDDBApp.cpp similarity index 100% rename from IRCDDBApp.cpp rename to IRCDDB/IRCDDBApp.cpp diff --git a/IRCDDBApp.h b/IRCDDB/IRCDDBApp.h similarity index 100% rename from IRCDDBApp.h rename to IRCDDB/IRCDDBApp.h diff --git a/IRCDDBClient.cpp b/IRCDDB/IRCDDBClient.cpp similarity index 100% rename from IRCDDBClient.cpp rename to IRCDDB/IRCDDBClient.cpp diff --git a/IRCDDBClient.h b/IRCDDB/IRCDDBClient.h similarity index 100% rename from IRCDDBClient.h rename to IRCDDB/IRCDDBClient.h diff --git a/IRCDDBMultiClient.cpp b/IRCDDB/IRCDDBMultiClient.cpp similarity index 100% rename from IRCDDBMultiClient.cpp rename to IRCDDB/IRCDDBMultiClient.cpp diff --git a/IRCDDBMultiClient.h b/IRCDDB/IRCDDBMultiClient.h similarity index 100% rename from IRCDDBMultiClient.h rename to IRCDDB/IRCDDBMultiClient.h diff --git a/IRCMessage.cpp b/IRCDDB/IRCMessage.cpp similarity index 100% rename from IRCMessage.cpp rename to IRCDDB/IRCMessage.cpp diff --git a/IRCMessage.h b/IRCDDB/IRCMessage.h similarity index 100% rename from IRCMessage.h rename to IRCDDB/IRCMessage.h diff --git a/IRCMessageQueue.cpp b/IRCDDB/IRCMessageQueue.cpp similarity index 100% rename from IRCMessageQueue.cpp rename to IRCDDB/IRCMessageQueue.cpp diff --git a/IRCMessageQueue.h b/IRCDDB/IRCMessageQueue.h similarity index 100% rename from IRCMessageQueue.h rename to IRCDDB/IRCMessageQueue.h diff --git a/IRCProtocol.cpp b/IRCDDB/IRCProtocol.cpp similarity index 100% rename from IRCProtocol.cpp rename to IRCDDB/IRCProtocol.cpp diff --git a/IRCProtocol.h b/IRCDDB/IRCProtocol.h similarity index 100% rename from IRCProtocol.h rename to IRCDDB/IRCProtocol.h diff --git a/IRCReceiver.cpp b/IRCDDB/IRCReceiver.cpp similarity index 100% rename from IRCReceiver.cpp rename to IRCDDB/IRCReceiver.cpp diff --git a/IRCReceiver.h b/IRCDDB/IRCReceiver.h similarity index 100% rename from IRCReceiver.h rename to IRCDDB/IRCReceiver.h diff --git a/IRCDDB/Makefile b/IRCDDB/Makefile new file mode 100644 index 0000000..d84f384 --- /dev/null +++ b/IRCDDB/Makefile @@ -0,0 +1,16 @@ +SRCS = $(wildcard *.cpp) +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) + +IRCDDB.a: $(OBJS) ../VersionInfo/GitVersion.h ../BaseCommon/BaseCommon.a + $(AR) rcs IRCDDB.a $(OBJS) + +%.o : %.cpp + $(CC) -I../BaseCommon -I../VersionInfo $(CPPFLAGS) -MMD -MD -c $< -o $@ + +.PHONY clean: +clean: + $(RM) *.o *.d IRCDDB.a + +../BaseCommon/BaseCommon.a: +../VersionInfo/GitVersion.h: diff --git a/Makefile b/Makefile index 45eb55d..9835c1f 100644 --- a/Makefile +++ b/Makefile @@ -43,44 +43,42 @@ OBJS = $(SRCS:.cpp=.o) DEPS = $(SRCS:.cpp=.d) .PHONY: all -all: dstargateway +all: DStarGateway/dstargateway tests -dstargateway : GitVersion.h $(OBJS) APRS/APRS.a BaseCommon/BaseCommon.a - $(CC) $(CPPFLAGS) -o dstargateway $(OBJS) APRS/APRS.a BaseCommon/BaseCommon.a $(LDFLAGS) +DStarGateway/dstargateway : VersionInfo/GitVersion.h $(OBJS) APRS/APRS.a Common/Common.a DStarBase/DStarBase.a IRCDDB/IRCDDB.a BaseCommon/BaseCommon.a + $(MAKE) -C DStarGateway %.o : %.cpp - $(CC) -IAPRS/ -IBaseCommon/ $(CPPFLAGS) -MMD -MD -c $< -o $@ + $(CC) -IAPRS/ -IBaseCommon/ -IDStarBase/ -IIRCDDB/ -IVersionInfo/ $(CPPFLAGS) -MMD -MD -c $< -o $@ + +APRS/APRS.a: BaseCommon/BaseCommon.a FORCE + $(MAKE) -C APRS + +Common/Common.a: VersionInfo/GitVersion.h APRS/APRS.a BaseCommon/BaseCommon.a FORCE + $(MAKE) -C Common BaseCommon/BaseCommon.a: FORCE $(MAKE) -C BaseCommon -APRS/APRS.a: BaseCommon/BaseCommon.a FORCE - $(MAKE) -C APRS +DStarBase/DStarBase.a: BaseCommon/BaseCommon.a FORCE + $(MAKE) -C DStarBase -GitVersion.h : FORCE -ifneq ("$(wildcard .git/index)","") - @echo "#pragma once" > /tmp/$@ - @echo "#include " >> /tmp/$@ - @echo "const std::string gitversion(\"$(shell git rev-parse --short HEAD)\");" >> /tmp/$@ -else - @echo "#pragma once" > /tmp/$@ - @echo "#include " >> /tmp/$@ - @echo "const std::string gitversion(\"0000000\");" >> /tmp/$@ -endif - @cmp -s /tmp/$@ $@; \ - RETVAL=$$?; \ - if [ $$RETVAL -ne 0 ]; then \ - echo "Git version has changed"; \ - cp -f /tmp/$@ $@; \ - fi; \ - rm /tmp/$@; +IRCDDB/IRCDDB.a: VersionInfo/GitVersion.h BaseCommon/BaseCommon.a FORCE + $(MAKE) -C IRCDDB + +VersionInfo/GitVersion.h: + $(MAKE) -C VersionInfo .PHONY: clean clean: - $(RM) GitVersion.h *.o *.d dstargateway $(MAKE) -C Tests clean $(MAKE) -C APRS clean + $(MAKE) -C Common clean $(MAKE) -C BaseCommon clean + $(MAKE) -C DStarBase clean + $(MAKE) -C DStarGateway clean + $(MAKE) -C IRCDDB clean + $(MAKE) -C VersionInfo -include $(DEPS) @@ -94,7 +92,7 @@ newhostfiles : @wget http://www.pistar.uk/downloads/DPlus_Hosts.txt -nv -O $(DATA_DIR)/DPlus_Hosts.txt .PHONY: install -install : dstargateway +install : DStarGateway/dstargateway # create user for daemon @useradd --user-group -M --system dstar --shell /bin/false || true @@ -109,13 +107,8 @@ install : dstargateway $(MAKE) -C Data install @chown -R dstar:dstar $(DATA_DIR) -# copy and adjust config - @cp -fn example.cfg $(CFG_DIR)/dstargateway.cfg - @sed -i "s|path=/var/log/dstargateway/|path=$(LOG_DIR)|g" $(CFG_DIR)/dstargateway.cfg - @sed -i "s|data=/usr/local/share/dstargateway.d/|data=$(DATA_DIR)|g" $(CFG_DIR)/dstargateway.cfg - -# copy binary - @cp -f dstargateway $(BIN_DIR) +#install executables + $(MAKE) -C DStarGateway install # SystemD service install @cp -f debian/dstargateway.service /lib/systemd/system/ @@ -144,12 +137,11 @@ removehostfiles : @rm -f $(DATA_DIR)/DPlus_Hosts.txt .PHONY tests: -tests : GitVersion.h -# force tests makefile to rebuild them with -DUNIT_TESTS, otherwise we end up with 2 mains - @touch DStarGatewayApp.cpp +tests : VersionInfo/GitVersion.h $(OBJS) APRS/APRS.a Common/Common.a DStarBase/DStarBase.a IRCDDB/IRCDDB.a BaseCommon/BaseCommon.a FORCE @$(MAKE) -C Tests dstargateway_tests .PHONY run-tests: +run-tests: tests @$(MAKE) -C Tests run-tests -FORCE: \ No newline at end of file +FORCE: diff --git a/Tests/Makefile b/Tests/Makefile index 39c4504..2aafd55 100644 --- a/Tests/Makefile +++ b/Tests/Makefile @@ -3,11 +3,11 @@ SRCS = $(wildcard *.cpp) $(wildcard ../*.cpp) $(wildcard */*.cpp) OBJS = $(SRCS:.cpp=.o) DEPS = $(SRCS:.cpp=.d) -dstargateway_tests: $(OBJS) - $(CC) $(CPPFLAGS) -o dstargateway_tests $(OBJS) $(LDFLAGS) -lgtest -lgtest_main +dstargateway_tests: ../VersionInfo/GitVersion.h $(OBJS) ../APRS/APRS.a ../IRCDDB/IRCDDB.a ../DStarBase/DStarBase.a ../BaseCommon/BaseCommon.a ../Common/Common.a + $(CC) $(CPPFLAGS) -o dstargateway_tests $(OBJS) ../Common/Common.a ../APRS/APRS.a ../DStarBase/DStarBase.a ../IRCDDB/IRCDDB.a ../BaseCommon/BaseCommon.a $(LDFLAGS) -lgtest -lgtest_main %.o : %.cpp - $(CC) $(CPPFLAGS) -DUNIT_TESTS -I../ -MMD -MD -c $< -o $@ + $(CC) $(CPPFLAGS) -DUNIT_TESTS -I../APRS -I../Common -I../BaseCommon -I../DStarBase -I../IRCDDB -I../VersionInfo -MMD -MD -c $< -o $@ -include $(DEPS) @@ -16,4 +16,11 @@ dstargateway_tests: $(OBJS) .PHONY clean : clean : - @$(RM) $(OBJS) $(DEPS) dstargateway_tests + @$(RM) *.o *.d dstargateway_tests + +../APRS/APRS.a: +../Common/Common.a: +../DStarBase/DStarBase.a: +../BaseCommon/BaseCommon.a: +../IRCDDB/IRCDDB.a: +../VersionInfo/GitVersion.h: diff --git a/VersionInfo/Makefile b/VersionInfo/Makefile new file mode 100644 index 0000000..0c6223e --- /dev/null +++ b/VersionInfo/Makefile @@ -0,0 +1,23 @@ +GitVersion.h : FORCE +ifneq ("$(wildcard .git/index)","") + @echo "#pragma once" > /tmp/$@ + @echo "#include " >> /tmp/$@ + @echo "const std::string gitversion(\"$(shell git rev-parse --short HEAD)\");" >> /tmp/$@ +else + @echo "#pragma once" > /tmp/$@ + @echo "#include " >> /tmp/$@ + @echo "const std::string gitversion(\"0000000\");" >> /tmp/$@ +endif + @cmp -s /tmp/$@ $@; \ + RETVAL=$$?; \ + if [ $$RETVAL -ne 0 ]; then \ + echo "Git version has changed"; \ + cp -f /tmp/$@ $@; \ + fi; \ + rm /tmp/$@; + +.PHONY: clean +clean: + $(RM) *.o *.d GitVersion.h + +FORCE: diff --git a/Version.h b/VersionInfo/Version.h similarity index 100% rename from Version.h rename to VersionInfo/Version.h