summaryrefslogtreecommitdiff
blob: ea1de16aeb48a1846e403a16b6d572f773fcde76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- app_ldap/Makefile.orig	2005-08-27 22:47:49.000000000 +0000
+++ app_ldap/Makefile	2005-08-27 22:50:37.000000000 +0000
@@ -9,20 +9,18 @@
 NAME=app_ldap
 CONF=ldap.conf
 
+DESTDIR=
+
 ifeq ($(shell ./check_has_cid.sh),yes)
-CFLAGS=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC -DCHANNEL_HAS_CID
+CFLAGS+=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC -DCHANNEL_HAS_CID
 else
-CFLAGS=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC
+CFLAGS+=-g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC
 endif
 
 LIBS=-llber -lldap
 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
 
@@ -34,13 +32,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}"