1 1.1 christos # $OpenLDAP$ 2 1.1 christos # This work is part of OpenLDAP Software <http://www.openldap.org/>. 3 1.1 christos # 4 1.1 christos # Copyright 1998-2023 The OpenLDAP Foundation. 5 1.1 christos # Copyright 2023 Ondej Kuznk, Symas Corp. All Rights Reserved. 6 1.1 christos # 7 1.1 christos # Redistribution and use in source and binary forms, with or without 8 1.1 christos # modification, are permitted only as authorized by the OpenLDAP 9 1.1 christos # Public License. 10 1.1 christos # 11 1.1 christos # A copy of this license is available in the file LICENSE in the 12 1.1 christos # top-level directory of the distribution or, alternatively, at 13 1.1 christos # <http://www.OpenLDAP.org/license.html>. 14 1.1 christos 15 1.1 christos LDAP_SRC = ../../.. 16 1.1 christos LDAP_BUILD = $(LDAP_SRC) 17 1.1 christos SRCDIR = ./ 18 1.1 christos LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd 19 1.1 christos LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \ 20 1.1 christos $(LDAP_BUILD)/libraries/liblber/liblber.la 21 1.1 christos 22 1.1 christos PLAT = UNIX 23 1.1 christos NT_LIB = -L$(LDAP_BUILD)/servers/slapd -lslapd 24 1.1 christos NT_LDFLAGS = -no-undefined -avoid-version 25 1.1 christos UNIX_LDFLAGS = -version-info $(LTVER) 26 1.1 christos 27 1.1 christos LIBTOOL = $(LDAP_BUILD)/libtool 28 1.1 christos INSTALL = /usr/bin/install 29 1.1 christos CC = gcc 30 1.1 christos OPT = -g -O2 31 1.1 christos DEFS = -DSLAPD_OVER_ALIAS=SLAPD_MOD_DYNAMIC 32 1.1 christos INCS = $(LDAP_INC) 33 1.1 christos LIBS = $($(PLAT)_LIB) $(LDAP_LIB) 34 1.1 christos LD_FLAGS = $(LDFLAGS) $($(PLAT)_LDFLAGS) -rpath $(moduledir) -module 35 1.1 christos 36 1.1 christos PROGRAMS = alias.la 37 1.1 christos MANPAGES = slapo-alias.5 38 1.1 christos CLEAN = *.o *.lo *.la .libs 39 1.1 christos LTVER = 0:0:0 40 1.1 christos 41 1.1 christos prefix=/usr/local 42 1.1 christos exec_prefix=$(prefix) 43 1.1 christos ldap_subdir=/openldap 44 1.1 christos 45 1.1 christos libdir=$(exec_prefix)/lib 46 1.1 christos libexecdir=$(exec_prefix)/libexec 47 1.1 christos moduledir = $(libexecdir)$(ldap_subdir) 48 1.1 christos mandir = $(exec_prefix)/share/man 49 1.1 christos man5dir = $(mandir)/man5 50 1.1 christos 51 1.1 christos all: $(PROGRAMS) 52 1.1 christos 53 1.1 christos d := 54 1.1 christos sp := 55 1.1 christos dir := tests 56 1.1 christos include $(dir)/Rules.mk 57 1.1 christos 58 1.1 christos .SUFFIXES: .c .o .lo 59 1.1 christos 60 1.1 christos .c.lo: 61 1.1 christos $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $< 62 1.1 christos 63 1.1 christos alias.la: alias.lo 64 1.1 christos $(LIBTOOL) --mode=link $(CC) $(LD_FLAGS) -o $@ $? $(LIBS) 65 1.1 christos 66 1.1 christos clean: 67 1.1 christos rm -rf $(CLEAN) 68 1.1 christos 69 1.1 christos install: install-lib install-man FORCE 70 1.1 christos 71 1.1 christos install-lib: $(PROGRAMS) 72 1.1 christos mkdir -p $(DESTDIR)$(moduledir) 73 1.1 christos for p in $(PROGRAMS) ; do \ 74 1.1 christos $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \ 75 1.1 christos done 76 1.1 christos 77 1.1 christos install-man: $(MANPAGES) 78 1.1 christos mkdir -p $(DESTDIR)$(man5dir) 79 1.1 christos $(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir) 80 1.1 christos 81 1.1 christos FORCE: 82 1.1 christos 83