From 3cf02e25bdee38baf182cfafcc0be4a5607c0f3f Mon Sep 17 00:00:00 2001 From: Shawn Chain Date: Fri, 5 Oct 2018 11:07:56 +0800 Subject: [PATCH] patch for openwrt --- Common/Makefile | 2 ++ Makefile | 17 ++--------------- common.mk | 27 +++++++++++++++++++++++++++ ircDDB/Makefile | 2 ++ ircDDBGateway/Makefile | 2 ++ 5 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 common.mk diff --git a/Common/Makefile b/Common/Makefile index 8643148..a71fdbf 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -1,3 +1,5 @@ +include ../common.mk + OBJECTS = AMBEData.o AnnouncementUnit.o APRSCollector.o APRSWriter.o APRSWriterThread.o AudioUnit.o CacheManager.o CallsignList.o \ CallsignServer.o CCITTChecksum.o CCSData.o CCSHandler.o CCSProtocolHandler.o ConnectData.o DCSHandler.o DCSProtocolHandler.o \ DCSProtocolHandlerPool.o DDData.o DDHandler.o DExtraHandler.o DExtraProtocolHandler.o DExtraProtocolHandlerPool.o \ diff --git a/Makefile b/Makefile index e3c3283..fb7e425 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,6 @@ -export DATADIR := "/usr/share/ircddbgateway" -export LOGDIR := "/var/log" -export CONFDIR := "/etc" -export BINDIR := "/usr/bin" +include common.mk -# Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet -# Add -DDEXTRA_LINK to the end of the CFLAGS line below to add DExtra linking to StarNet - -export CXX := $(shell wx-config --cxx) -export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' -export GUILIBS := $(shell wx-config --libs adv,core,base) -export LIBS := $(shell wx-config --libs base) -export LDFLAGS := - -all: ircDDBGateway/ircddbgatewayd ircDDBGatewayConfig/ircddbgatewayconfig APRSTransmit/aprstransmitd RemoteControl/remotecontrold \ - StarNetServer/starnetserverd TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd +all: ircDDBGateway/ircddbgatewayd ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a make -C ircDDBGateway diff --git a/common.mk b/common.mk new file mode 100644 index 0000000..16e0902 --- /dev/null +++ b/common.mk @@ -0,0 +1,27 @@ + +# Add -DDCS_LINK to the end of the CFLAGS line below to add DCS linking to StarNet +# Add -DDEXTRA_LINK to the end of the CFLAGS line below to add DExtra linking to StarNet + +ifeq ($(OPENWRT),1) +DATADIR := "/etc/mmdvm/ircddbgateway" +LOGDIR := "/var/log/mmdvm" +CONFDIR := "/etc" +BINDIR := "/usr/bin" + +CFLAGS += -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' +LIBS += -lwxbase_u +LDFLAGS := + +else +DATADIR := "/usr/share/ircddbgateway" +LOGDIR := "/var/log" +CONFDIR := "/etc" +BINDIR := "/usr/bin" + +CXX := $(shell wx-config --cxx) +CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' +GUILIBS := $(shell wx-config --libs adv,core,base) +LIBS := $(shell wx-config --libs base) +LDFLAGS := + +endif diff --git a/ircDDB/Makefile b/ircDDB/Makefile index b841a5e..f93728e 100644 --- a/ircDDB/Makefile +++ b/ircDDB/Makefile @@ -1,3 +1,5 @@ +include ../common.mk + OBJECTS = IRCClient.o IRCDDBApp.o IRCDDBClient.o IRCDDB.o IRCDDBMultiClient.o IRCMessage.o IRCMessageQueue.o IRCProtocol.o IRCReceiver.o \ IRCutils.o diff --git a/ircDDBGateway/Makefile b/ircDDBGateway/Makefile index 3bf974e..62016ab 100644 --- a/ircDDBGateway/Makefile +++ b/ircDDBGateway/Makefile @@ -1,3 +1,5 @@ +include ../common.mk + OBJECTS = IRCDDBGatewayAppD.o IRCDDBGatewayStatusData.o IRCDDBGatewayThread.o IRCDDBGatewayThreadHelper.o all: ircddbgatewayd