Makefile improvements

pull/12/head
Tom Early 7 years ago
parent 6744860651
commit 7adfc39cd1

@ -38,40 +38,37 @@ OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d) DEPS = $(SRCS:.cpp=.d)
ALL_PROGRAMS=qngateway qnlink qnremote qnvoice qnrelay qndvap qndvrptr qnitap ALL_PROGRAMS=qngateway qnlink qnremote qnvoice qnrelay qndvap qndvrptr qnitap
MDV_PROGRAMS=qngateway qnlink qnremote qnvoice qnrelay BASE_PROGRAMS=qngateway qnlink qnremote qnvoice
DVP_PROGRAMS=qngateway qnlink qnremote qnvoice qndvap
DVR_PROGRAMS=qngateway qnlink qnremote qnvoice qndvrptr
TAP_PROGRAMS=qngateway qnlink qnremote qnvoice qnitap
all : $(ALL_PROGRAMS) all : $(ALL_PROGRAMS)
mmdvm : $(MDV_PROGRAMS) relay : qnrelay
dvap : $(DVP_PROGRAMS) dvap : qndvap
dvrptr : $(DVR_PROGRAMS) dvrptr : qndvrptr
itap : $(TAP_PROGRAMS) itap : qnitap
qngateway : $(IRCOBJS) QnetGateway.o aprs.o UnixDgramSocket.o QnetConfigure.o qngateway : QnetGateway.o aprs.o UnixDgramSocket.o QnetConfigure.o $(IRCOBJS)
g++ $(CPPFLAGS) -o qngateway QnetGateway.o aprs.o UnixDgramSocket.o QnetConfigure.o $(IRCOBJS) $(LDFLAGS) -pthread g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS) -pthread
qnlink : QnetLink.o DPlusAuthenticator.o TCPReaderWriterClient.o Random.o UnixDgramSocket.o QnetConfigure.o qnlink : QnetLink.o DPlusAuthenticator.o TCPReaderWriterClient.o Random.o UnixDgramSocket.o QnetConfigure.o
g++ $(CPPFLAGS) -o qnlink QnetLink.o DPlusAuthenticator.o TCPReaderWriterClient.o Random.o UnixDgramSocket.o QnetConfigure.o $(LDFLAGS) -pthread g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS) -pthread
qnrelay : QnetRelay.o UnixDgramSocket.o QnetConfigure.o qnrelay : QnetRelay.o UnixDgramSocket.o QnetConfigure.o
g++ $(CPPFLAGS) -o qnrelay QnetRelay.o UnixDgramSocket.o QnetConfigure.o $(LDFLAGS) g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
qnitap : QnetITAP.o Random.o UnixDgramSocket.o QnetConfigure.o qnitap : QnetITAP.o Random.o UnixDgramSocket.o QnetConfigure.o
g++ $(CPPFLAGS) -o qnitap QnetITAP.o Random.o UnixDgramSocket.o QnetConfigure.o $(LDFLAGS) g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
qndvap : QnetDVAP.o DVAPDongle.o Random.o $(DSTROBJS) UnixDgramSocket.o QnetConfigure.o qndvap : QnetDVAP.o DVAPDongle.o Random.o UnixDgramSocket.o QnetConfigure.o $(DSTROBJS)
g++ $(CPPFLAGS) -o qndvap QnetDVAP.o DVAPDongle.o Random.o UnixDgramSocket.o QnetConfigure.o $(DSTROBJS) $(LDFLAGS) -pthread g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS) -pthread
qndvrptr : QnetDVRPTR.o $(DSTROBJS) Random.o UnixDgramSocket.o QnetConfigure.o qndvrptr : QnetDVRPTR.o Random.o UnixDgramSocket.o QnetConfigure.o $(DSTROBJS)
g++ $(CPPFLAGS) -o qndvrptr QnetDVRPTR.o Random.o UnixDgramSocket.o QnetConfigure.o $(DSTROBJS) $(LDFLAGS) g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
qnremote : QnetRemote.o Random.o UnixDgramSocket.o QnetConfigure.o qnremote : QnetRemote.o Random.o UnixDgramSocket.o QnetConfigure.o
g++ $(CPPFLAGS) -o qnremote QnetRemote.o Random.o UnixDgramSocket.o QnetConfigure.o $(LDFLAGS) g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
qnvoice : QnetVoice.o Random.o QnetConfigure.o qnvoice : QnetVoice.o Random.o QnetConfigure.o
g++ $(CPPFLAGS) -o qnvoice QnetVoice.o Random.o QnetConfigure.o $(LDFLAGS) g++ $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
%.o : %.cpp %.o : %.cpp
g++ $(CPPFLAGS) -MMD -MD -c $< -o $@ g++ $(CPPFLAGS) -MMD -MD -c $< -o $@
@ -83,11 +80,12 @@ clean:
-include $(DEPS) -include $(DEPS)
install : $(MDV_PROGRAMS) gwys.txt qn.cfg installbase : $(BASE_PROGRAMS) gwys.txt qn.cfg
######### QnetGateway ######### ######### QnetGateway #########
/bin/cp -f qngateway $(BINDIR) /bin/cp -f qngateway $(BINDIR)
/bin/cp -f qnremote qnvoice $(BINDIR) /bin/cp -f qnremote qnvoice $(BINDIR)
/bin/ln -s $(shell pwd)/qn.cfg $(CFGDIR) /bin/ln -s $(shell pwd)/qn.cfg $(CFGDIR)
/bin/cp -f defaults $(CFGDIR)
/bin/cp -f system/qngateway.service $(SYSDIR) /bin/cp -f system/qngateway.service $(SYSDIR)
systemctl enable qngateway.service systemctl enable qngateway.service
systemctl daemon-reload systemctl daemon-reload
@ -101,106 +99,39 @@ install : $(MDV_PROGRAMS) gwys.txt qn.cfg
systemctl enable qnlink.service systemctl enable qnlink.service
systemctl daemon-reload systemctl daemon-reload
systemctl start qnlink.service systemctl start qnlink.service
installrelay : qnrelay
######### QnetRelay ######### ######### QnetRelay #########
/bin/cp -f qnrelay $(BINDIR) /bin/ln -f qnrelay $(BINDIR)/qnrelay$(MODULE)
/bin/cp -f system/qnrelay.service $(SYSDIR) /bin/cp -f system/qnrelay$(MODULE).service $(SYSDIR)
systemctl enable qnrelay.service systemctl enable qnrelay$(MODULE).service
systemctl daemon-reload systemctl daemon-reload
systemctl start qnrelay.service systemctl start qnrelay$(MODULE).service
######### MMDVMHost #########
installitap : $(TAP_PROGRAMS) gwys.txt qn.cfg installitap : qnitap
######### QnetGateway #########
/bin/cp -f qngateway $(BINDIR)
/bin/cp -f qnremote qnvoice $(BINDIR)
/bin/ln -s $(shell pwd)/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/ln -s $(shell pwd)/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
######### QnetITAP ######### ######### QnetITAP #########
/bin/cp -f qnitap $(BINDIR) /bin/ln -f qnitap $(BINDIR)/qnitap$(MODULE)
/bin/cp -f system/qnitap.service $(SYSDIR) /bin/cp -f system/qnitap$(MODULE).service $(SYSDIR)
systemctl enable qnitap.service systemctl enable qnitap$(MODULE).service
systemctl daemon-reload
systemctl start qnitap.service
installicom : $(ICM_PROGRAMS) gwys.txt qn.cfg
######### QnetGateway #########
/bin/cp -f qnicomgateway $(BINDIR)
/bin/cp -f qnremote qnvoice $(BINDIR)
/bin/ln -s $(shell pwd)/qn.cfg $(CFGDIR)
/bin/cp -f system/qnigateway.service $(SYSDIR)
systemctl enable qnigateway.service
systemctl daemon-reload
systemctl start qnigateway.service
######### QnetLink #########
/bin/cp -f qnlink $(BINDIR)
/bin/cp -f announce/*.dat $(CFGDIR)
/bin/ln -s $(shell pwd)/gwys.txt $(CFGDIR)
/bin/cp -f exec_?.sh $(CFGDIR)
/bin/cp -f system/qnlink.service $(SYSDIR)
systemctl enable qnlink.service
systemctl daemon-reload systemctl daemon-reload
systemctl start qnlink.service systemctl start qnitap$(MODULE).service
installdvap : $(DVP_PROGRAMS) gwys.txt qn.cfg installdvap : qndvap
######### QnetGateway #########
/bin/cp -f qngateway $(BINDIR)
/bin/cp -f qnremote qnvoice $(BINDIR)
/bin/ln -s $(shell pwd)/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/ln -s $(shell pwd)/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 ######### ######### QnetDVAP #########
/bin/cp -f qndvap $(BINDIR) /bin/ln -f qndvap $(BINDIR)/qndvap$(MODULE)
/bin/cp -f system/qndvap.service $(SYSDIR) /bin/cp -f system/qndvap$(MODULE).service $(SYSDIR)
systemctl enable qndvap.service systemctl enable qndvap$(MODULE).service
systemctl daemon-reload systemctl daemon-reload
systemctl start qndvap.service systemctl start qndvap$(MODULE).service
installdvrptr : $(DVR_PROGRAMS) gwys.txt qn.cfg installdvrptr : qndvrptr
######### QnetGateway #########
/bin/cp -f qngateway $(BINDIR)
/bin/cp -f qnremote qnvoice $(BINDIR)
/bin/ln -s $(shell pwd)/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/ln -s $(shell pwd)/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 ######### ######### QnetDVRPTR #########
/bin/cp -f qndvrptr $(BINDIR) /bin/ln -f qndvrptr $(BINDIR)/qndvrptr$(MODULE)
/bin/cp -f system/qndvrptr.service $(SYSDIR) /bin/cp -f system/qndvrptr$(MODULE).service $(SYSDIR)
systemctl enable qndvrptr.service systemctl enable qndvrptr$(MODULE).service
systemctl daemon-reload systemctl daemon-reload
systemctl start qndvrptr.service systemctl start qndvrptr$(MODULE).service
installdtmf : qndtmf installdtmf : qndtmf
/bin/ln -s $(shell pwd)/qndtmf $(BINDIR) /bin/ln -s $(shell pwd)/qndtmf $(BINDIR)
@ -209,25 +140,25 @@ installdtmf : qndtmf
systemctl daemon-reload systemctl daemon-reload
systemctl start qndtmf.service systemctl start qndtmf.service
installmmdvm : $(MMPATH)/MMDVMHost $(MMPATH)/MMDVM.qn installmmdvm : $(MMPATH)/MMDVMHost $(MMPATH)/MMDVM$(MODULE).qn
/bin/cp -f $(MMPATH)/MMDVMHost $(BINDIR) /bin/ln -f $(MMPATH)/MMDVMHost $(BINDIR)/MMDVMHost$(MODULE)
/bin/ln -s $(shell pwd)/$(MMPATH)/MMDVM.qn $(CFGDIR) /bin/ln -s $(shell pwd)/$(MMPATH)/MMDVM$(MODULE).qn $(CFGDIR)
/bin/cp -f system/mmdvm.service $(SYSDIR) /bin/cp -f system/mmdvm$(MODULE).service $(SYSDIR)
/bin/cp -f system/mmdvm.timer $(SYSDIR) /bin/cp -f system/mmdvm.timer $(SYSDIR)/mmdvm$(MODULE).timer
systemctl enable mmdvm.timer systemctl enable mmdvm$(MODULE).timer
systemctl daemon-reload systemctl daemon-reload
systemctl start mmdvm.service systemctl start mmdvm$(MODULE).service
uninstallmmdvm : uninstallmmdvm :
systemctl stop mmdvm.service systemctl stop mmdvm.service
systemctl disable mmdvm.timer systemctl disable mmdvm.timer
/bin/rm -f $(SYSDIR)/mmdvm.service /bin/rm -f $(SYSDIR)/mmdvm.service
/bin/rm -f $(SYSDIR)/mmdvm.timer /bin/rm -f $(SYSDIR)/mmdvm$(MODULE).timer
/bin/rm -f $(BINDIR)/MMDVMHost /bin/rm -f $(BINDIR)/MMDVMHost
/bin/rm -f $(CFGDIR)/MMDVM.qn /bin/rm -f $(CFGDIR)/MMDVM.qn
sudo systemctl daemon-reload sudo systemctl daemon-reload
uninstall : uninstallbase :
######### QnetGateway ######### ######### QnetGateway #########
systemctl stop qngateway.service systemctl stop qngateway.service
systemctl disable qngateway.service systemctl disable qngateway.service
@ -236,6 +167,7 @@ uninstall :
/bin/rm -f $(BINDIR)/qnremote /bin/rm -f $(BINDIR)/qnremote
/bin/rm -f $(BINDIR)/qnvoice /bin/rm -f $(BINDIR)/qnvoice
/bin/rm -f $(CFGDIR)/qn.cfg /bin/rm -f $(CFGDIR)/qn.cfg
/bin/rm -f $(CFGDIR)/defaults
######### QnetLink ######### ######### QnetLink #########
systemctl stop qnlink.service systemctl stop qnlink.service
systemctl disable qnlink.service systemctl disable qnlink.service
@ -245,105 +177,37 @@ uninstall :
/bin/rm -f $(CFGDIR)/RPT_STATUS.txt /bin/rm -f $(CFGDIR)/RPT_STATUS.txt
/bin/rm -f $(CFGDIR)/gwys.txt /bin/rm -f $(CFGDIR)/gwys.txt
/bin/rm -f $(CFGDIR)/exec_?.sh /bin/rm -f $(CFGDIR)/exec_?.sh
uninstallrelay :
######### QnetRelay ######### ######### QnetRelay #########
systemctl stop qnrelay.service systemctl stop qnrelay$(MODULE).service
systemctl disable qnrelay.service systemctl disable qnrelay$(MODULE).service
/bin/rm -f $(SYSDIR)/qnrelay.service /bin/rm -f $(SYSDIR)/qnrelay$(MODULE).service
/bin/rm -f $(BINDIR)/qnrelay /bin/rm -f $(BINDIR)/qnrelay$(MODULE)
systemctl daemon-reload systemctl daemon-reload
uninstallitap : uninstallitap :
######### QnetGateway #########
systemctl stop qngateway.service
systemctl disable qngateway.service
/bin/rm -f $(SYSDIR)/qngateway.service
/bin/rm -f $(BINDIR)/qngateway
/bin/rm -f $(BINDIR)/qnremote
/bin/rm -f $(BINDIR)/qnvoice
/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)/*.dat
/bin/rm -f $(CFGDIR)/RPT_STATUS.txt
/bin/rm -f $(CFGDIR)/gwys.txt
/bin/rm -f $(CFGDIR)/exec_?.sh
######### QnetITAP ######### ######### QnetITAP #########
systemctl stop qnitap.service systemctl stop qnitap$(MODULE).service
systemctl disable qnitap.service systemctl disable qnitap$(MODULE).service
/bin/rm -f $(SYSDIR)/qnitap.service /bin/rm -f $(SYSDIR)/qnitap$(MODULE).service
/bin/rm -f $(BINDIR)/qnitap /bin/rm -f $(BINDIR)/qnitap$(MODULE)
systemctl daemon-reload systemctl daemon-reload
uninstallicom :
######### QnetGateway #########
systemctl stop qnigateway.service
systemctl disable qnigateway.service
/bin/rm -f $(SYSDIR)/qnigateway.service
/bin/rm -f $(BINDIR)/qnigateway
/bin/rm -f $(BINDIR)/qnremote
/bin/rm -f $(BINDIR)/qnvoice
/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)/*.dat
/bin/rm -f $(CFGDIR)/RPT_STATUS.txt
/bin/rm -f $(CFGDIR)/gwys.txt
/bin/rm -f $(CFGDIR)/exec_?.sh
uninstalldvap : uninstalldvap :
######### QnetGateway #########
systemctl stop qngateway.service
systemctl disable qngateway.service
/bin/rm -f $(SYSDIR)/qngateway.service
/bin/rm -f $(BINDIR)/qngateway
/bin/rm -f $(BINDIR)/qnremote
/bin/rm -f $(BINDIR)/qnvoice
/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)/*.dat
/bin/rm -f $(CFGDIR)/RPT_STATUS.txt
/bin/rm -f $(CFGDIR)/gwys.txt
/bin/rm -f $(CFGDIR)/exec_?.sh
######### QnetDVAP ######### ######### QnetDVAP #########
systemctl stop qndvap.service systemctl stop qndvap$(MODULE).service
systemctl disable qndvap.service systemctl disable qndvap$(MODULE).service
/bin/rm -f $(SYSDIR)/qndvap.service /bin/rm -f $(SYSDIR)/qndvap$(MODULE).service
/bin/rm -f $(BINDIR)/qndvap /bin/rm -f $(BINDIR)/qndvap$(MODULE)
systemctl daemon-reload systemctl daemon-reload
uninstalldvrptr : uninstalldvrptr :
######### QnetGateway #########
systemctl stop qngateway.service
systemctl disable qngateway.service
/bin/rm -f $(SYSDIR)/qngateway.service
/bin/rm -f $(BINDIR)/qngateway
/bin/rm -f $(BINDIR)/qnremote
/bin/rm -f $(BINDIR)/qnvoice
/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)/*.dat
/bin/rm -f $(CFGDIR)/RPT_STATUS.txt
/bin/rm -f $(CFGDIR)/gwys.txt
/bin/rm -f $(CFGDIR)/exec_?.sh
######### QnetDVRPTR ######### ######### QnetDVRPTR #########
systemctl stop qndvrptr.service systemctl stop qndvrptr$(MODULE).service
systemctl disable qndvrptr.service systemctl disable qndvrptr$(MODULE).service
/bin/rm -f $(SYSDIR)/qndvrptr.service /bin/rm -f $(SYSDIR)/qndvrptr$(MODULE).service
/bin/rm -f $(BINDIR)/qndvrptr /bin/rm -f $(BINDIR)/qndvrptr$(MODULE)
systemctl daemon-reload systemctl daemon-reload
uninstalldtmf : uninstalldtmf :

@ -1,12 +0,0 @@
[Unit]
Description=QnetIcomGateway
Requires=network.target
After=systemd-user-session.service network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/qnigateway /usr/local/etc/qn.cfg
Restart=always
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save

Powered by TurnKey Linux.