# # Bluetooth Presense Daemon # # Copyright (C) 2003 Digium, Inc. # # Mark Spencer # # Distributed under the terms of the GNU General Public License # Version 2 or later at your option. # CFLAGS+=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC OBJS=btpd.o md5.o aescrypt.o aeskey.o aestab.o LIBS=-lbluetooth CHAN=$(shell if [ -f /usr/include/asterisk/channel.h ]; then echo "chan_btp.so"; fi) ifeq (${OSARCH},Darwin) SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace else SOLINK=-shared -Xlinker -x endif MODULES_DIR=/usr/lib/asterisk/modules %.so : %.o $(CC) $(SOLINK) -o $@ $< all: btpd $(CHAN) btpd: $(OBJS) $(CC) -o btpd $(OBJS) $(LIBS) clean: rm -f btpd $(OBJS) chan_btp.so install: all install -m 755 btpd /usr/sbin/btpd if ! [ -f /etc/btpd.conf ]; then \ install -m 644 btpd.conf.sample /etc/btpd.conf ; \ fi if [ -f chan_btp.so ]; then install -m 755 chan_btp.so $(MODULES_DIR); fi if [ -d /etc/asterisk ] && ! [ -f /etc/asterisk/btp.conf ]; then \ install -m 644 btp.conf.sample /etc/asterisk/btp.conf ; \ fi