#-----------------------------------------------------------------------------
# Copyright (c) 1990 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       LDAP library makefile
#
#-----------------------------------------------------------------------------

SRCS	= bind.c open.c result.c error.c compare.c search.c parse.c \
	modify.c add.c modrdn.c delete.c abandon.c synchronous.c \
	kerberos.c
OBJS	= bind.o open.o result.o error.o compare.o search.o parse.o \
	modify.o add.o modrdn.o delete.o abandon.o synchronous.o \
	kerberos.o

CFLAGS	= $(ACFLAGS) -I../h $(KRBINCLUDEDIR)

default:
	(cd ../; make ldap-library)

all:	libldap.a ltest

libldap.a:	$(OBJS) version.o
	ar ruv $@ $(OBJS) version.o
	ranlib $@

ltest:	libldap.a test.o ../liblber/liblber.a
	$(CC) $(ALDFLAGS) -o $@ test.o -L. -L../liblber -lldap -llber \
		$(KRBLIBDIR) $(KRBLIBS)

version.c: Version.c ../version
	(u=$${USER-root} v=`cat ../version` d=`pwd` h=`hostname` t=`date`; \
	sed -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	-e "s|%VERSION%|$${v}|" \
	< Version.c > version.c)

install:	$(LIBDIR)/libldap.a

$(LIBDIR)/libldap.a:	libldap.a
	install -c -m 644 libldap.a $(LIBDIR)
	(cd /tmp; ranlib $@)

lint:;
	lint -I../h $(SRCS)

5lint:;
	/usr/5bin/lint -I../h $(SRCS)

clean:;
	rm -f libldap.a ltest *.o core a.out version.c

depend:;
	../mkdep $(CFLAGS) $(SRCS)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

bind.o: bind.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
bind.o: /usr/include/string.h /usr/include/sys/stdtypes.h
bind.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
bind.o: /usr/include/sys/sysmacros.h /usr/include/sys/time.h
bind.o: /usr/include/time.h /usr/include/sys/stdtypes.h
open.o: open.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
open.o: /usr/include/string.h /usr/include/sys/stdtypes.h
open.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
open.o: /usr/include/sys/sysmacros.h /usr/include/sys/socket.h
open.o: /usr/include/netinet/in.h /usr/include/netdb.h
result.o: result.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
result.o: /usr/include/string.h /usr/include/sys/stdtypes.h
result.o: /usr/include/sys/time.h /usr/include/time.h
result.o: /usr/include/sys/stdtypes.h /usr/include/sys/types.h
result.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
result.o: /usr/include/sys/socket.h
error.o: error.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
error.o: /usr/include/string.h /usr/include/sys/stdtypes.h
compare.o: compare.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
compare.o: /usr/include/string.h /usr/include/sys/stdtypes.h
search.o: search.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
search.o: /usr/include/string.h /usr/include/sys/stdtypes.h
parse.o: parse.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
parse.o: /usr/include/ctype.h /usr/include/string.h /usr/include/sys/stdtypes.h
modify.o: modify.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
modify.o: /usr/include/string.h /usr/include/sys/stdtypes.h
add.o: add.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h /usr/include/string.h
add.o: /usr/include/sys/stdtypes.h
modrdn.o: modrdn.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
modrdn.o: /usr/include/string.h /usr/include/sys/stdtypes.h
delete.o: delete.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
delete.o: /usr/include/string.h /usr/include/sys/stdtypes.h
abandon.o: abandon.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
abandon.o: /usr/include/string.h /usr/include/sys/stdtypes.h
synchronous.o: synchronous.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
synchronous.o: /usr/include/string.h /usr/include/sys/stdtypes.h
synchronous.o: /usr/include/sys/time.h /usr/include/time.h
synchronous.o: /usr/include/sys/stdtypes.h /usr/include/sys/types.h
synchronous.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
synchronous.o: /usr/include/sys/socket.h
kerberos.o: kerberos.c ../h/lber.h ../h/ldap.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
