1 # $OpenLDAP$ 2 # This work is part of OpenLDAP Software <http://www.openldap.org/>. 3 # 4 # Copyright 2008-2024 The OpenLDAP Foundation. 5 # Portions Copyright 2008 Howard Chu, Symas Corp. All Rights Reserved. 6 # 7 # Redistribution and use in source and binary forms, with or without 8 # modification, are permitted only as authorized by the OpenLDAP 9 # Public License. 10 # 11 # A copy of this license is available in the file LICENSE in the 12 # top-level directory of the distribution or, alternatively, at 13 # <http://www.OpenLDAP.org/license.html>. 14 15 # Path to the OpenLDAP source tree 16 LDAP_SRC=../../.. 17 18 # Path to the OpenLDAP object tree - same as above unless 19 # you're doing out-of-tree builds. 20 LDAP_BUILD=$(LDAP_SRC) 21 22 LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd 23 LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \ 24 $(LDAP_BUILD)/libraries/liblber/liblber.la 25 26 NLDAPD_INC=-Inss-pam-ldapd 27 28 LIBTOOL = $(LDAP_BUILD)/libtool 29 INSTALL = /usr/bin/install 30 OPT = -g -O2 31 CC = gcc 32 DEFS = 33 INCS = $(LDAP_INC) $(NLDAPD_INC) 34 LIBS = $(LDAP_LIB) 35 36 prefix=/usr/local 37 exec_prefix=$(prefix) 38 ldap_subdir=/openldap 39 40 libdir=$(exec_prefix)/lib 41 libexecdir=$(exec_prefix)/libexec 42 moduledir = $(libexecdir)$(ldap_subdir) 43 sysconfdir = $(prefix)/etc$(ldap_subdir) 44 schemadir = $(sysconfdir)/schema 45 mandir = $(exec_prefix)/share/man 46 man5dir = $(mandir)/man5 47 48 all: nssov.la 49 50 XOBJS = tio.lo 51 52 OBJS = alias.lo ether.lo group.lo host.lo netgroup.lo network.lo \ 53 nssov.lo passwd.lo protocol.lo rpc.lo service.lo shadow.lo pam.lo 54 55 MANPAGES = slapo-nssov.5 56 57 .SUFFIXES: .c .o .lo 58 59 .c.lo: 60 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $< 61 62 tio.lo: nss-pam-ldapd/tio.c 63 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $? 64 65 $(OBJS): nssov.h 66 67 nssov.la: $(OBJS) $(XOBJS) 68 $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info 0:0:0 \ 69 -rpath $(moduledir) -module -o $@ $(OBJS) $(XOBJS) $(LIBS) 70 71 install: install-lib install-man FORCE 72 73 install-lib: nssov.la 74 mkdir -p $(DESTDIR)$(moduledir) 75 $(LIBTOOL) --mode=install cp nssov.la $(DESTDIR)$(moduledir) 76 cp ldapns.schema $(DESTDIR)$(schemadir) 77 78 install-man: $(MANPAGES) 79 mkdir -p $(DESTDIR)$(man5dir) 80 $(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir) 81 82 FORCE: 83 84 clean: 85 rm -f *.*o *.la .libs/* 86 rm -rf .libs 87