xref: /netbsd-src/external/bsd/openldap/dist/contrib/slapd-modules/smbk5pwd/Makefile (revision 8ecbf5f02b752fcb7debe1a8fab1dc82602bc760)
1# $OpenLDAP$
2# This work is part of OpenLDAP Software <http://www.openldap.org/>.
3#
4# Copyright 1998-2020 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
15LDAP_SRC = ../../..
16LDAP_BUILD = $(LDAP_SRC)
17LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
18LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
19	$(LDAP_BUILD)/libraries/liblber/liblber.la
20
21SSL_INC =
22SSL_LIB = -lcrypto
23
24HEIMDAL_INC = -I/usr/heimdal/include
25HEIMDAL_LIB = -L/usr/heimdal/lib -lkrb5 -lkadm5srv
26
27LIBTOOL = $(LDAP_BUILD)/libtool
28CC = gcc
29OPT = -g -O2 -Wall
30# Omit DO_KRB5, DO_SAMBA or DO_SHADOW if you don't want to support it.
31DEFS = -DDO_KRB5 -DDO_SAMBA -DDO_SHADOW
32INCS = $(LDAP_INC) $(HEIMDAL_INC) $(SSL_INC)
33LIBS = $(LDAP_LIB) $(HEIMDAL_LIB) $(SSL_LIB)
34
35PROGRAMS = smbk5pwd.la
36LTVER = 0:0:0
37
38prefix=/usr/local
39exec_prefix=$(prefix)
40ldap_subdir=/openldap
41
42libdir=$(exec_prefix)/lib
43libexecdir=$(exec_prefix)/libexec
44moduledir = $(libexecdir)$(ldap_subdir)
45
46.SUFFIXES: .c .o .lo
47
48.c.lo:
49	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
50
51all: $(PROGRAMS)
52
53smbk5pwd.la:	smbk5pwd.lo
54	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
55	-rpath $(moduledir) -module -o $@ $? $(LIBS)
56
57clean:
58	rm -rf *.o *.lo *.la .libs
59
60install: $(PROGRAMS)
61	mkdir -p $(DESTDIR)$(moduledir)
62	for p in $(PROGRAMS) ; do \
63		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
64	done
65
66