1# $OpenLDAP$ 2 3LDAP_SRC = ../../.. 4LDAP_BUILD = $(LDAP_SRC) 5LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd 6LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \ 7 $(LDAP_BUILD)/libraries/liblber/liblber.la 8 9LIBTOOL = $(LDAP_BUILD)/libtool 10CC = gcc 11OPT = -g -O2 -Wall 12DEFS = 13INCS = $(LDAP_INC) 14LIBS = $(LDAP_LIB) 15 16PROGRAMS = pw-kerberos.la pw-netscape.la pw-radius.la pw-apr1.la 17LTVER = 0:0:0 18 19prefix=/usr/local 20exec_prefix=$(prefix) 21ldap_subdir=/openldap 22 23libdir=$(exec_prefix)/lib 24libexecdir=$(exec_prefix)/libexec 25moduledir = $(libexecdir)$(ldap_subdir) 26 27.SUFFIXES: .c .o .lo 28 29.c.lo: 30 $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $< 31 32all: $(PROGRAMS) 33 34pw-kerberos.la: kerberos.lo 35 $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \ 36 -rpath $(moduledir) -module -o $@ $? -lkrb5 37 38pw-netscape.la: netscape.lo 39 $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \ 40 -rpath $(moduledir) -module -o $@ $? 41 42pw-radius.la: radius.lo 43 $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \ 44 -rpath $(moduledir) -module -o $@ $? -lradius 45 46pw-apr1.la: apr1.lo 47 $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \ 48 -rpath $(moduledir) -module -o $@ $? 49 50clean: 51 rm -rf *.o *.lo *.la .libs 52 53install: $(PROGRAMS) 54 mkdir -p $(DESTDIR)$(moduledir) 55 for p in $(PROGRAMS) ; do \ 56 $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \ 57 done 58 59