1 # $OpenLDAP$ 2 # This work is part of OpenLDAP Software <http://www.openldap.org/>. 3 # 4 # Copyright 1998-2024 The OpenLDAP Foundation. 5 # Copyright 2022 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 SRCDIR = ./ 22 23 PLAT = UNIX 24 NT_LIB = -L$(LDAP_BUILD)/servers/slapd -lslapd 25 NT_LDFLAGS = -no-undefined -avoid-version 26 UNIX_LDFLAGS = -version-info $(LTVER) 27 28 LIBTOOL = $(LDAP_BUILD)/libtool 29 INSTALL = /usr/bin/install 30 CC = gcc 31 OPT = -g -O2 32 DEFS = -DSLAPD_MOD_CIBOOLEAN=SLAPD_MOD_DYNAMIC 33 INCS = $(LDAP_INC) 34 LIBS = $($(PLAT)_LIB) $(LDAP_LIB) 35 LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module 36 37 PROGRAMS = ciboolean.la 38 MANPAGES = slapo-ciboolean.5 39 LTVER = 0:0:0 40 CLEAN = *.o *.lo *.la .libs 41 prefix=/usr/local 42 exec_prefix=$(prefix) 43 ldap_subdir=/openldap 44 45 libdir=$(exec_prefix)/lib 46 libexecdir=$(exec_prefix)/libexec 47 moduledir = $(libexecdir)$(ldap_subdir) 48 mandir = $(exec_prefix)/share/man 49 man5dir = $(mandir)/man5 50 51 .SUFFIXES: .c .o .lo 52 53 .c.lo: 54 $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $< 55 56 all: $(PROGRAMS) 57 58 d := 59 sp := 60 dir := tests 61 include $(dir)/Rules.mk 62 63 64 ciboolean.la: ciboolean.lo 65 $(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS) 66 67 clean: 68 rm -rf $(CLEAN) 69 70 install: install-lib install-man 71 72 install-lib: $(PROGRAMS) 73 mkdir -p $(DESTDIR)$(moduledir) 74 for p in $(PROGRAMS) ; do \ 75 $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \ 76 done 77 78 install-man: $(MANPAGES) 79 mkdir -p $(DESTDIR)$(man5dir) 80 $(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir) 81