--- res_bondia/Makefile.orig 2005-09-03 15:32:44.000000000 +0000 +++ res_bondia/Makefile 2005-09-04 21:53:29.000000000 +0000 @@ -9,15 +9,13 @@ NAME=res_bondia CONF=bonjour.conf -CFLAGS=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC +DESTDIR= + +CFLAGS+=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC LIBS=-ldns_sd RES=$(shell if [ -f /usr/include/asterisk/channel.h ]; then echo "$(NAME).so"; fi) -ifeq (${OSARCH},Darwin) -SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace -else -SOLINK=-shared -Xlinker -x -endif +SOLINK=$(shell /usr/bin/asterisk-config --solink) MODULES_DIR=/usr/lib/asterisk/modules @@ -29,13 +27,9 @@ clean: rm -f $(NAME).o $(NAME).so -install: all - if ! [ -f /etc/asterisk/$(CONF) ]; then \ - install -m 644 $(CONF).sample /etc/asterisk/$(CONF) ; \ - fi - if [ -f $(NAME).so ]; then \ - install -m 755 $(NAME).so $(MODULES_DIR) ; \ - fi +install: + install -D -m 644 $(CONF).sample $(DESTDIR)/etc/asterisk/$(CONF) + install -D -m 755 $(NAME).so $(DESTDIR)$(MODULES_DIR)/$(NAME).so reload: install asterisk -rx "unload ${RES}"