# Copyright (c) 2018 by Thomas A. Early N7TAE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # locations for the executibles and other files are set here # NOTE: IF YOU CHANGE THESE, YOU WILL NEED TO UPDATE THE service.* FILES AND # if you change these locations, make sure the sgs.service file is updated! BINDIR=/usr/local/bin CFGDIR=/usr/local/etc MMPATH=../MMDVMHost SYSDIR=/lib/systemd/system # use this if you want debugging help in the case of a crash #CPPFLAGS=-g -ggdb -W -Wall -std=c++11 -DCFG_DIR=\"$(CFGDIR)\" # or, you can choose this for a much smaller executable without debugging help CPPFLAGS=-W -Wall -std=c++11 LDFLAGS=-L/usr/lib -lconfig++ -lrt DSTROBJS = dstar_dv.o golay23.o IRCOBJS = IRCDDB.o IRCClient.o IRCReceiver.o IRCMessageQueue.o IRCProtocol.o IRCMessage.o IRCDDBApp.o IRCutils.o $(DSTROBJS) SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) DEPS = $(SRCS:.cpp=.d) PROGRAMS=qngateway qnlink qnrelay qndvap qndvrptr qnlinktest qnlinktestaudio all : $(PROGRAMS) qngateway : $(IRCOBJS) QnetGateway.o aprs.o g++ $(CPPFLAGS) -o qngateway QnetGateway.o aprs.o $(IRCOBJS) $(LDFLAGS) -pthread qnlink : QnetLink.o g++ $(CPPFLAGS) -o qnlink QnetLink.o $(LDFLAGS) -pthread qnrelay : QnetRelay.o g++ $(CPPFLAGS) -o qnrelay QnetRelay.o $(LDFLAGS) qndvap : QnetDVAP.o DVAPDongle.o $(DSTROBJS) g++ $(CPPFLAGS) -o qndvap QnetDVAP.o DVAPDongle.o $(DSTROBJS) $(LDFLAGS) -pthread qndvrptr : QnetDVRPTR.o $(DSTROBJS) g++ $(CPPFLAGS) -o qndvrptr QnetDVRPTR.o $(DSTROBJS) $(LDFLAGS) qnlinktest : QnetLinkTest.o g++ $(CPPFLAGS) -o qnlinktest QnetLinkTest.o -lrt qnlinktestaudio : QnetLinkTestAudio.o g++ $(CPPFLAGS) -o qnlinktestaudio QnetLinkTestAudio.o -lrt %.o : %.cpp g++ $(CPPFLAGS) -MMD -MD -c $< -o $@ .PHONY: clean clean: $(RM) $(OBJS) $(DEPS) $(PROGRAMS) -include $(DEPS) install : qngateway qnlink qnrelay ######### QnetGateway ######### /bin/cp -f qngateway $(BINDIR) /bin/cp -f qn.cfg $(CFGDIR) /bin/cp -f system/qngateway.service $(SYSDIR) systemctl enable qngateway.service systemctl daemon-reload systemctl start qngateway.service ######### QnetLink ######### /bin/cp -f qnlink $(BINDIR) /bin/cp -f announce/*.dat $(CFGDIR) /bin/cp -f gwys.txt $(CFGDIR) /bin/cp -f exec_?.sh $(CFGDIR) /bin/cp -f system/qnlink.service $(SYSDIR) systemctl enable qnlink.service systemctl daemon-reload systemctl start qnlink.service ######### QnetRelay ######### /bin/cp -f qnrelay $(BINDIR) /bin/cp -f system/qnrelay.service $(SYSDIR) systemctl enable qnrelay.service systemctl daemon-reload systemctl start qnrelay.service installdvap : qngateway qnlink qndvap ######### QnetGateway ######### /bin/cp -f qngateway $(BINDIR) /bin/cp -f qn.cfg $(CFGDIR) /bin/cp -f system/qngateway.service $(SYSDIR) systemctl enable qngateway.service systemctl daemon-reload systemctl start qngateway.service ######### QnetLink ######### /bin/cp -f qnlink $(BINDIR) /bin/cp -f announce/*.dat $(CFGDIR) /bin/cp -f gwys.txt $(CFGDIR) /bin/cp -f exec_?.sh $(CFGDIR) /bin/cp -f system/qnlink.service $(SYSDIR) systemctl enable qnlink.service systemctl daemon-reload systemctl start qnlink.service ######### QnetDVAP ######### /bin/cp -f qndvap $(BINDIR) /bin/cp -f system/qndvap.service $(SYSDIR) systemctl enable qndvap.service systemctl daemon-reload systemctl start qndvap.service installdvrptr : qngateway qnlink qndvrptr ######### QnetGateway ######### /bin/cp -f qngateway $(BINDIR) /bin/cp -f qn.cfg $(CFGDIR) /bin/cp -f system/qngateway.service $(SYSDIR) systemctl enable qngateway.service systemctl daemon-reload systemctl start qngateway.service ######### QnetLink ######### /bin/cp -f qnlink $(BINDIR) /bin/cp -f announce/*.dat $(CFGDIR) /bin/cp -f gwys.txt $(CFGDIR) /bin/cp -f exec_?.sh $(CFGDIR) /bin/cp -f system/qnlink.service $(SYSDIR) systemctl enable qnlink.service systemctl daemon-reload systemctl start qnlink.service ######### QnetDVRPTR ######### /bin/cp -f qndvrptr $(BINDIR) /bin/cp -f system/qndvrptr.service $(SYSDIR) systemctl enable qndvrptr.service systemctl daemon-reload systemctl start qndvrptr.service installdtmfs : qnlinktest /bin/cp -f qnlinktest $(BINDIR) /bin/cp -f proc_qnlinktest $(BINDIR) /bin/cp -f system/qnlinktest.service $(SYSDIR) systemctl enable qnlinktest.service systemctl daemon-reload systemctl start qnlinktest.service installmmdvm : /bin/cp -f $(MMPATH)/MMDVMHost $(BINDIR) /bin/cp -f $(MMPATH)/MMDVM.qn $(CFGDIR) /bin/cp -f system/mmdvm.service $(SYSDIR) /bin/cp -f system/mmdvm.timer $(SYSDIR) systemctl enable mmdvm.timer systemctl daemon-reload systemctl start mmdvm.service uninstallmmdvm : systemctl stop mmdvm.service systemctl disable mmdvm.timer /bin/rm -f $(SYSDIR)/mmdvm.service /bin/rm -f $(SYSDIR)/mmdvm.timer /bin/rm -f $(BINDIR)/MMDVMHost /bin/rm -f $(CFGDIR)/MMDVM.qn sudo systemctl daemon-reload uninstall : ######### QnetGateway ######### systemctl stop qngateway.service systemctl disable qngateway.service /bin/rm -f $(SYSDIR)/qngateway.service /bin/rm -f $(BINDIR)/qngateway /bin/rm -f $(CFGDIR)/qn.cfg ######### QnetLink ######### systemctl stop qnlink.service systemctl disable qnlink.service /bin/rm -f $(SYSDIR)/qnlink.service /bin/rm -f $(BINDIR)/qnlink /bin/rm -f $(CFGDIR)/already_linked.dat /bin/rm -f $(CFGDIR)/already_unlinked.dat /bin/rm -f $(CFGDIR)/failed_linked.dat /bin/rm -f $(CFGDIR)/id.dat /bin/rm -f $(CFGDIR)/linked.dat /bin/rm -f $(CFGDIR)/unlinked.dat /bin/rm -f $(CFGDIR)/RPT_STATUS.txt /bin/rm -f $(CFGDIR)/gwys.txt /bin/rm -f $(CFGDIR)/exec_?.sh ######### QnetRelay ######### systemctl stop qnrelay.service systemctl disable qnrelay.service /bin/rm -f $(SYSDIR)/qnrelay.service /bin/rm -f $(BINDIR)/qnrelay systemctl daemon-reload uninstalldvap : ######### QnetGateway ######### systemctl stop qngateway.service systemctl disable qngateway.service /bin/rm -f $(SYSDIR)/qngateway.service /bin/rm -f $(BINDIR)/qngateway /bin/rm -f $(CFGDIR)/qn.cfg ######### QnetLink ######### systemctl stop qnlink.service systemctl disable qnlink.service /bin/rm -f $(SYSDIR)/qnlink.service /bin/rm -f $(BINDIR)/qnlink /bin/rm -f $(CFGDIR)/already_linked.dat /bin/rm -f $(CFGDIR)/already_unlinked.dat /bin/rm -f $(CFGDIR)/failed_linked.dat /bin/rm -f $(CFGDIR)/id.dat /bin/rm -f $(CFGDIR)/linked.dat /bin/rm -f $(CFGDIR)/unlinked.dat /bin/rm -f $(CFGDIR)/RPT_STATUS.txt /bin/rm -f $(CFGDIR)/gwys.txt /bin/rm -f $(CFGDIR)/exec_?.sh ######### QnetDVAP ######### systemctl stop qndvap.service systemctl disable qndvap.service /bin/rm -f $(SYSDIR)/qndvap.service /bin/rm -f $(BINDIR)/qndvap systemctl daemon-reload uninstalldvrptr : ######### QnetGateway ######### systemctl stop qngateway.service systemctl disable qngateway.service /bin/rm -f $(SYSDIR)/qngateway.service /bin/rm -f $(BINDIR)/qngateway /bin/rm -f $(CFGDIR)/qn.cfg ######### QnetLink ######### systemctl stop qnlink.service systemctl disable qnlink.service /bin/rm -f $(SYSDIR)/qnlink.service /bin/rm -f $(BINDIR)/qnlink /bin/rm -f $(CFGDIR)/already_linked.dat /bin/rm -f $(CFGDIR)/already_unlinked.dat /bin/rm -f $(CFGDIR)/failed_linked.dat /bin/rm -f $(CFGDIR)/id.dat /bin/rm -f $(CFGDIR)/linked.dat /bin/rm -f $(CFGDIR)/unlinked.dat /bin/rm -f $(CFGDIR)/RPT_STATUS.txt /bin/rm -f $(CFGDIR)/gwys.txt /bin/rm -f $(CFGDIR)/exec_?.sh ######### QnetDVRPTR ######### systemctl stop qndvrptr.service systemctl disable qndvrptr.service /bin/rm -f $(SYSDIR)/qndvrptr.service /bin/rm -f $(BINDIR)/qndvrptr systemctl daemon-reload uninstalldtmfs: systemctl stop qnlinktest.service systemctl disable qnlinktest.service /bin/rm -f $(SYSDIR)/qnlinktest.service systemctl daemon-reload /bin/rm -f $(BINDIR)/qnlinktest /bin/rm -f $(BINDIR)/proc_qnlinktest systemctl daemon-reload