]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/autogroup/Makefile
Merge remote branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / contrib / slapd-modules / autogroup / Makefile
index 1efd4fe662e428db94758a3292df9b54e0b03314..70146ac648476fcb5d845da3ed55232147c2626e 100644 (file)
@@ -1,12 +1,27 @@
-CPPFLAGS=-I../../../include -I../../../servers/slapd
-#LDFLAGS=-L/usr/local/openldap/lib
-#LDFLAGS=-L/home/mszulczynski/autogroup/openldap/lib/
-CC=gcc
+LIBTOOL=../../../libtool
 
-all: autogroup.so
+CPPFLAGS+=-I../../../include -I../../../servers/slapd
 
-autogroup.so: autogroup.c
-       $(CC) -shared -fPIC $(CPPFLAGS) $(LDFLAGS) -Wall -o $@ $?
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+
+all: autogroup.la
+
+autogroup.lo:  autogroup.c
+       $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
+
+autogroup.la:  autogroup.lo
+       $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+       -rpath $(libdir) -module -o $@ $? 
 
 clean:
-       rm autogroup.so
+       rm -f autogroup.lo autogroup.la
+
+install: autogroup.la
+       mkdir -p $(DESTDIR)$(moduledir)
+       $(LIBTOOL) --mode=install cp autogroup.la $(DESTDIR)$(moduledir)
+       $(LIBTOOL) --finish $(DESTDIR)$(moduledir)