]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/allowed/Makefile
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / slapd-modules / allowed / Makefile
index 148460d0daee37cfeba505b84ec686d178eba565..d395386f9dfb576d3e49c59b06b70abea1524da5 100644 (file)
@@ -1,7 +1,7 @@
 # $OpenLDAP$
 # This work is part of OpenLDAP Software <http://www.openldap.org/>.
 #
-# Copyright 1998-2012 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>.
 
-PREFIX=/opt/openldap-HEAD
+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=../../../libtool
-OPT=-g -O2
-CC=gcc
+LIBTOOL = $(LDAP_BUILD)/libtool
+CC = gcc
+OPT = -g -O2 -Wall
+DEFS = -DSLAPD_OVER_ALLOWED=SLAPD_MOD_DYNAMIC
+INCS = $(LDAP_INC)
+LIBS = $(LDAP_LIB)
 
-DEFS=-DSLAPD_OVER_ALLOWED=SLAPD_MOD_DYNAMIC
+PROGRAMS = allowed.la
+LTVER = 0:0:0
 
-LDAP_INC=-I../../../include -I../../../servers/slapd
-INCS=$(LDAP_INC)
+prefix=/usr/local
+exec_prefix=$(prefix)
+ldap_subdir=/openldap
 
-LDAP_LIB=-lldap_r -llber -L../../../lib
-LDAP_LIB=
-LIBS=$(LDAP_LIB)
+libdir=$(exec_prefix)/lib
+libexecdir=$(exec_prefix)/libexec
+moduledir = $(libexecdir)$(ldap_subdir)
 
-all:   allowed.la
+.SUFFIXES: .c .o .lo
 
+.c.lo:
+       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
 
-allowed.lo:    allowed.c
-       $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
+all: $(PROGRAMS)
 
-allowed.la:    allowed.lo
-       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
-       -rpath $(PREFIX)/lib -module -o $@ $? $(LIBS)
+allowed.la: allowed.lo
+       $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
+       -rpath $(moduledir) -module -o $@ $? $(LIBS)
 
 clean:
-       rm -f allowed.o allowed.lo allowed.la
+       rm -rf *.o *.lo *.la .libs
+
+install: $(PROGRAMS)
+       mkdir -p $(DESTDIR)$(moduledir)
+       for p in $(PROGRAMS) ; do \
+               $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
+       done
 
-install: allowed.la
-       mkdir -p $(PREFIX)/libexec/openldap
-       $(LIBTOOL) --mode=install cp allowed.la $(PREFIX)/libexec/openldap
-       $(LIBTOOL) --finish $(PREFIX)/libexec/openldap