ircDDBGateway/Makefile

129 lines
3.9 KiB
Makefile
Raw Normal View History

export BUILD ?= debug
ifeq ($(TARGET), opendv)
export DATADIR ?= /usr/share/opendv
export LOGDIR ?= /var/log/opendv
export CONFDIR ?= /etc
export BINDIR ?= /usr/sbin
else
export DATADIR ?= /usr/share/ircddbgateway
export LOGDIR ?= /var/log
export CONFDIR ?= /etc
export BINDIR ?= /usr/bin
endif
2018-05-15 20:32:38 +02:00
# 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
# Add -DUSE_GPSD to the end of the CFLAGS line to enable the use of gpsd, and add -lgps to
2020-06-21 19:02:05 +02:00
# end of the LIBS line.
DEBUGFLAGS := -g -D_DEBUG
RELEASEFLAGS := -DNDEBUG -DwxDEBUG_LEVEL=0
2018-05-15 22:19:47 +02:00
export CXX := $(shell wx-config --cxx)
export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='"$(LOGDIR)"' -DCONF_DIR='"$(CONFDIR)"' -DDATA_DIR='"$(DATADIR)"'
ifeq ($(BUILD), debug)
export CFLAGS := $(CFLAGS) $(DEBUGFLAGS)
else ifeq ($(BUILD), release)
export CFLAGS := $(CFLAGS) $(RELEASEFLAGS)
endif
2020-06-21 19:02:05 +02:00
export LIBS := $(shell wx-config --libs base,net)
2018-05-15 22:19:47 +02:00
export LDFLAGS :=
2018-05-15 20:32:38 +02:00
.PHONY: all
2020-06-04 09:16:48 +02:00
all: ircDDBGateway/ircddbgatewayd APRSTransmit/aprstransmitd RemoteControl/remotecontrold \
StarNetServer/starnetserverd TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd
2018-05-15 20:32:38 +02:00
ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a force
$(MAKE) -C ircDDBGateway
2018-05-15 20:32:38 +02:00
APRSTransmit/aprstransmitd: Common/Common.a force
$(MAKE) -C APRSTransmit
2018-05-15 20:32:38 +02:00
RemoteControl/remotecontrold: Common/Common.a force
$(MAKE) -C RemoteControl
2018-05-15 20:32:38 +02:00
StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a force
$(MAKE) -C StarNetServer
2018-05-15 20:32:38 +02:00
TextTransmit/texttransmitd: Common/Common.a force
$(MAKE) -C TextTransmit
2018-05-15 20:32:38 +02:00
TimerControl/timercontrold: Common/Common.a force
$(MAKE) -C TimerControl
2018-05-15 20:32:38 +02:00
TimeServer/timeserverd: Common/Common.a force
$(MAKE) -C TimeServer
2018-05-15 20:32:38 +02:00
VoiceTransmit/voicetransmitd: Common/Common.a force
$(MAKE) -C VoiceTransmit
2018-05-15 20:32:38 +02:00
Common/Common.a: force
$(MAKE) -C Common
2018-05-15 20:32:38 +02:00
ircDDB/IRCDDB.a: force
$(MAKE) -C ircDDB
2018-05-15 20:32:38 +02:00
.PHONY: installdirs
installdirs: force
/bin/mkdir -p $(DESTDIR)$(DATADIR) $(DESTDIR)$(LOGDIR) $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR)
.PHONY: install
install: all installdirs
ifeq ($(TARGET), opendv)
useradd --user-group -M --system opendv --shell /bin/false || true
# Add the opendv user to the audio group so that it can open audio
# devices when using the audio based drivers such as the Sound Card
# one. Maybe this should be moved to DStarRepeater instead ...
usermod --groups audio --append opendv || true
usermod --groups dialout --append opendv || true
usermod --groups gpio --append opendv || true
mkdir /var/log/opendv || true
chown opendv:opendv /var/log/opendv
endif
$(MAKE) -C Data install
$(MAKE) -C APRSTransmit install
$(MAKE) -C ircDDBGateway install
$(MAKE) -C RemoteControl install
$(MAKE) -C StarNetServer install
$(MAKE) -C TextTransmit install
$(MAKE) -C TimerControl install
$(MAKE) -C TimeServer install
$(MAKE) -C VoiceTransmit install
2018-05-15 22:19:47 +02:00
.PHONY: clean
2018-05-15 20:32:38 +02:00
clean:
$(MAKE) -C Common clean
$(MAKE) -C ircDDB clean
$(MAKE) -C APRSTransmit clean
$(MAKE) -C ircDDBGateway clean
$(MAKE) -C RemoteControl clean
$(MAKE) -C StarNetServer clean
$(MAKE) -C TextTransmit clean
$(MAKE) -C TimerControl clean
$(MAKE) -C TimeServer clean
$(MAKE) -C VoiceTransmit clean
$(MAKE) -C ircDDBGatewayConfig clean
2018-05-15 20:32:38 +02:00
2023-03-31 01:33:46 +02:00
.PHONY: uninstall
uninstall:
ifeq ($(TARGET), opendv)
userdel opendv || true
rm -r /var/log/opendv || true
rm $(DESTDIR)/etc/systemd/system/ircddbgatewayd.service
2023-03-31 01:33:46 +02:00
endif
rm -r $(DESTDIR)$(DATADIR) || true
rm $(DESTDIR)$(BINDIR)/aprstransmitd || true
rm $(DESTDIR)$(BINDIR)/ircddbgatewayd || true
rm $(DESTDIR)$(BINDIR)/remotecontrold || true
rm $(DESTDIR)$(BINDIR)/starnetserverd || true
rm $(DESTDIR)$(BINDIR)/texttransmitd || true
rm $(DESTDIR)$(BINDIR)/timercontrold || true
rm $(DESTDIR)$(BINDIR)/timeserverd || true
@echo "*** NOTE: Leaving /etc/ircddbgateway in place ***"
.PHONY: force
force :
@true