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