]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/autogroup/Makefile
Merge remote-tracking branch 'origin/mdb.RE/0.9' into OPENLDAP_REL_ENG_2_4
[openldap] / contrib / slapd-modules / autogroup / Makefile
index 70146ac648476fcb5d845da3ed55232147c2626e..efd9678eeff17c6d57d69d993ccc1a604038cd8a 100644 (file)
@@ -1,27 +1,46 @@
-LIBTOOL=../../../libtool
+# $OpenLDAP$
 
-CPPFLAGS+=-I../../../include -I../../../servers/slapd
+LDAP_SRC = ../../..
+LDAP_BUILD = $(LDAP_SRC)
+LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
+LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
+       $(LDAP_BUILD)/libraries/liblber/liblber.la
+
+LIBTOOL = $(LDAP_BUILD)/libtool
+CC = gcc
+OPT = -g -O2 -Wall
+DEFS = 
+INCS = $(LDAP_INC)
+LIBS = $(LDAP_LIB)
+
+PROGRAMS = autogroup.la
+LTVER = 0:0:0
 
-ldap_subdir = openldap
 prefix=/usr/local
-exec_prefix = $(prefix)
-libdir = $(exec_prefix)/lib
-libexecdir = $(exec_prefix)/libexec
-moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+exec_prefix=$(prefix)
+ldap_subdir=/openldap
+
+libdir=$(exec_prefix)/lib
+libexecdir=$(exec_prefix)/libexec
+moduledir = $(libexecdir)$(ldap_subdir)
 
-all: autogroup.la
+.SUFFIXES: .c .o .lo
 
-autogroup.lo:  autogroup.c
-       $(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
+.c.lo:
+       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
 
-autogroup.la:  autogroup.lo
-       $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-       -rpath $(libdir) -module -o $@ $? 
+all: $(PROGRAMS)
+
+autogroup.la: autogroup.lo
+       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
+       -rpath $(moduledir) -module -o $@ $? $(LIBS)
 
 clean:
-       rm -f autogroup.lo autogroup.la
+       rm -rf *.o *.lo *.la .libs
 
-install: autogroup.la
+install: $(PROGRAMS)
        mkdir -p $(DESTDIR)$(moduledir)
-       $(LIBTOOL) --mode=install cp autogroup.la $(DESTDIR)$(moduledir)
-       $(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+       for p in $(PROGRAMS) ; do \
+               $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
+       done
+