]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/samba4/Makefile
Fix modrdn unique check
[openldap] / contrib / slapd-modules / samba4 / Makefile
index 5ede541314a8dfeda02f93fa13ebfeeba3073bd9..0d839eec73c39b41f8237c602b143b66e307e2dc 100644 (file)
@@ -1,7 +1,7 @@
 # $OpenLDAP$
 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
 #
-# Copyright 1998-2010 The OpenLDAP Foundation.
+# Copyright 1998-2013 The OpenLDAP Foundation.
 # Copyright 2004 Howard Chu, Symas Corp. All Rights Reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # top-level directory of the distribution or, alternatively, at
 # <http://www.OpenLDAP.org/license.html>.
 
-LDAP_SRC=../../..
-# craft according to your installation
-LDAP_BUILD=../../../../ldap-devel
+LDAP_SRC = ../../..
+LDAP_BUILD = ../../..
+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
-OPT=-g -O2
-CC=gcc
+LIBTOOL = $(LDAP_BUILD)/libtool
+CC = gcc
+OPT = -g -O2 -Wall
+DEFS = -DSLAPD_OVER_RDNVAL=SLAPD_MOD_DYNAMIC \
+       -DSLAPD_OVER_PGUID=SLAPD_MOD_DYNAMIC \
+       -DSLAPD_OVER_VERNUM=SLAPD_MOD_DYNAMIC
+INCS = $(LDAP_INC)
+LIBS = $(LDAP_LIB)
 
-DEFS=-DSLAPD_OVER_RDNVAL=2
-
-LDAP_INC=-I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd \
-       -I$(LDAP_BUILD)/include
-INCS=$(LDAP_INC)
-
-LDAP_LIB=-lldap_r -llber
-LIBS=$(LDAP_LIB)
+PROGRAMS = pguid.la rdnval.la vernum.la
+LTVER = 0:0:0
 
 prefix=/usr/local
 exec_prefix=$(prefix)
@@ -37,19 +38,31 @@ libdir=$(exec_prefix)/lib
 libexecdir=$(exec_prefix)/libexec
 moduledir = $(libexecdir)$(ldap_subdir)
 
-all:   rdnval.la
+.SUFFIXES: .c .o .lo
+
+.c.lo:
+       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
+
+all: $(PROGRAMS)
 
-rdnval.lo:     rdnval.c
-       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
+pguid.la: pguid.lo
+       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
+       -rpath $(moduledir) -module -o $@ $? $(LIBS)
+
+rdnval.la: rdnval.lo
+       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
+       -rpath $(moduledir) -module -o $@ $? $(LIBS)
 
-rdnval.la:     rdnval.lo
-       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
+vernum.la: vernum.lo
+       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
        -rpath $(moduledir) -module -o $@ $? $(LIBS)
 
 clean:
-       rm -f rdnval.o rdnval.lo rdnval.la
+       rm -rf *.o *.lo *.la .libs
 
-install: rdnval.la
+install: $(PROGRAMS)
        mkdir -p $(DESTDIR)$(moduledir)
-       $(LIBTOOL) --mode=install cp rdnval.la $(DESTDIR)$(moduledir)
+       for p in $(PROGRAMS) ; do \
+               $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
+       done