1 # $OpenLDAP$ 2 # This work is part of OpenLDAP Software <http://www.openldap.org/>. 3 # 4 # Copyright 1998-2024 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 15 LDAP_SRC = ../../.. 16 LDAP_BUILD = $(LDAP_SRC) 17 LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd 18 LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \ 19 $(LDAP_BUILD)/libraries/liblber/liblber.la 20 21 SSL_INC = 22 SSL_LIB = -lcrypto 23 24 HEIMDAL_INC = -I/usr/heimdal/include 25 HEIMDAL_LIB = -L/usr/heimdal/lib -lkrb5 -lkadm5srv 26 27 PLAT = UNIX 28 NT_LIB = -L$(LDAP_BUILD)/servers/slapd -lslapd 29 NT_LDFLAGS = -no-undefined -avoid-version 30 UNIX_LDFLAGS = -version-info $(LTVER) 31 32 LIBTOOL = $(LDAP_BUILD)/libtool 33 INSTALL = /usr/bin/install 34 CC = gcc 35 OPT = -g -O2 36 # Omit DO_KRB5, DO_SAMBA or DO_SHADOW if you don't want to support it. 37 DEFS = -DDO_KRB5 -DDO_SAMBA -DDO_SHADOW 38 INCS = $(LDAP_INC) $(HEIMDAL_INC) $(SSL_INC) 39 LIBS = $($(PLAT)_LIB) $(LDAP_LIB) $(HEIMDAL_LIB) $(SSL_LIB) 40 LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module 41 42 PROGRAMS = smbk5pwd.la 43 MANPAGES = slapo-smbk5pwd.5 44 LTVER = 0:0:0 45 46 prefix=/usr/local 47 exec_prefix=$(prefix) 48 ldap_subdir=/openldap 49 50 libdir=$(exec_prefix)/lib 51 libexecdir=$(exec_prefix)/libexec 52 moduledir = $(libexecdir)$(ldap_subdir) 53 mandir = $(exec_prefix)/share/man 54 man5dir = $(mandir)/man5 55 56 .SUFFIXES: .c .o .lo 57 58 .c.lo: 59 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $< 60 61 all: $(PROGRAMS) 62 63 smbk5pwd.la: smbk5pwd.lo 64 $(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS) 65 66 clean: 67 rm -rf *.o *.lo *.la .libs 68 69 install: install-lib install-man FORCE 70 71 install-lib: $(PROGRAMS) 72 mkdir -p $(DESTDIR)$(moduledir) 73 for p in $(PROGRAMS) ; do \ 74 $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \ 75 done 76 77 install-man: $(MANPAGES) 78 mkdir -p $(DESTDIR)$(man5dir) 79 $(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir) 80 81 FORCE: 82 83