1# $OpenLDAP$
2# This work is part of OpenLDAP Software <http://www.openldap.org/>.
3#
4# Copyright 1998-2011 The OpenLDAP Foundation.
5# Copyright 2004 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
15LIBTOOL=../../../libtool
16OPT=-g -O2
17CC=gcc
18
19# Omit DO_KRB5, DO_SAMBA or DO_SHADOW if you don't want to support it.
20DEFS=-DDO_KRB5 -DDO_SAMBA -DDO_SHADOW
21
22HEIMDAL_INC=-I/usr/heimdal/include
23SSL_INC=
24LDAP_INC=-I../../../include -I../../../servers/slapd
25INCS=$(LDAP_INC) $(HEIMDAL_INC) $(SSL_INC)
26
27HEIMDAL_LIB=-L/usr/heimdal/lib -lkrb5 -lkadm5srv
28SSL_LIB=-lcrypto
29LDAP_LIB=-lldap_r -llber
30LIBS=$(LDAP_LIB) $(HEIMDAL_LIB) $(SSL_LIB)
31
32prefix=/usr/local
33exec_prefix=$(prefix)
34ldap_subdir=/openldap
35
36libdir=$(exec_prefix)/lib
37libexecdir=$(exec_prefix)/libexec
38moduledir = $(libexecdir)$(ldap_subdir)
39
40all:	smbk5pwd.la
41
42
43smbk5pwd.lo:	smbk5pwd.c
44	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
45
46smbk5pwd.la:	smbk5pwd.lo
47	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
48	-rpath $(moduledir) -module -o $@ $? $(LIBS)
49
50clean:
51	rm -f smbk5pwd.lo smbk5pwd.la
52
53install: smbk5pwd.la
54	mkdir -p $(DESTDIR)$(moduledir)
55	$(LIBTOOL) --mode=install cp smbk5pwd.la $(DESTDIR)$(moduledir)
56