#-----------------------------------------------------------------------------
# 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.
#
#       X.500 ldap finger daemon makefile
#
#-----------------------------------------------------------------------------

SRCS	= main.c
OBJS	= main.o

CFLAGS	= -I../h $(ACFLAGS)
LIBS	= -lldap -llber $(KRBLIBFLAG) $(KRBLIBS)
CC	= cc

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

all:	in.xfingerd

in.xfingerd:	version.o
	$(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o \
		-L../libldap -L../liblber $(LIBS)

version.c:	$(OBJS) ../libldap/libldap.a
	rm -f $@
	(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 > $@)

install:	$(ETCDIR)/in.xfingerd

$(ETCDIR)/in.xfingerd:	in.xfingerd
	$(INSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(ETCDIR)

lint:;
	lint $(SRCS)

5lint:;
	/usr/5bin/lint $(SRCS)

clean:;
	rm -f *.o core a.out version.c in.xfingerd

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

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

main.o: main.c ../h/lber.h ../h/ldap.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
