#-----------------------------------------------------------------------------
# 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.
#
#       gopher to x.500 gateware server makefile
#
#-----------------------------------------------------------------------------

SRCS	= go500.c go500gw.c detach.c
OBJS	= go500.o go500gw.o detach.o
GOOBJS	= go500.o detach.o
GWOBJS	= go500gw.o detach.o

CFLAGS	= -I../h $(ACFLAGS)
LIBS	= -lldap -llber $(KRBLIBDIR) $(KRBLIBS)
DLIBS	= ../libldap/libldap.a ../liblber/liblber.a

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

all:	go500gw go500

go500gw:	go500gw.o detach.o version.o $(DLIBS)
	cc $(ALDFLAGS) -o $@ $(GWOBJS) -L../libldap -L../liblber $(LIBS)

go500:	go500.o detach.o version.o $(DLIBS)
	cc $(ALDFLAGS) -o $@ $(GOOBJS) -L../libldap -L../liblber $(LIBS)

version.c: Version.c
	(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:	$(ETCDIR)/go500 $(ETCDIR)/go500gw $(ETCDIR)/go500gw.help

$(ETCDIR)/go500:	go500
	install -c -m 755 go500 $(ETCDIR)

$(ETCDIR)/go500gw:	go500gw
	install -c -m 755 go500gw $(ETCDIR)

$(ETCDIR)/go500gw.help:	go500gw.help
	install -c -m 644 go500gw.help $(ETCDIR)

lint:;
	lint -I. $(SRCS)

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

clean:;
	rm -f *.o core a.out version.c go500gw go500

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

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

go500.o: go500.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
go500.o: /usr/include/string.h /usr/include/sys/stdtypes.h /usr/include/ctype.h
go500.o: /usr/include/sys/types.h /usr/include/sys/stdtypes.h
go500.o: /usr/include/sys/sysmacros.h /usr/include/sys/time.h
go500.o: /usr/include/time.h /usr/include/sys/stdtypes.h
go500.o: /usr/include/sys/socket.h /usr/include/netinet/in.h
go500.o: /usr/include/arpa/inet.h /usr/include/netdb.h
go500.o: /usr/include/sys/syslog.h /usr/include/sys/wait.h
go500.o: /usr/include/sys/stdtypes.h /usr/include/signal.h
go500.o: /usr/include/sys/signal.h /usr/include/vm/faultcode.h
go500.o: /usr/include/sys/stdtypes.h
go500gw.o: go500gw.c ../h/lber.h ../h/ldap.h /usr/include/stdio.h
go500gw.o: /usr/include/string.h /usr/include/sys/stdtypes.h
go500gw.o: /usr/include/ctype.h /usr/include/sys/types.h
go500gw.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
go500gw.o: /usr/include/sys/param.h /usr/include/machine/param.h
go500gw.o: /usr/include/sys/signal.h /usr/include/vm/faultcode.h
go500gw.o: /usr/include/sys/stdtypes.h /usr/include/sys/types.h
go500gw.o: /usr/include/sys/time.h /usr/include/time.h
go500gw.o: /usr/include/sys/stdtypes.h /usr/include/sys/socket.h
go500gw.o: /usr/include/netinet/in.h /usr/include/arpa/inet.h
go500gw.o: /usr/include/netdb.h /usr/include/sys/syslog.h
go500gw.o: /usr/include/sys/wait.h /usr/include/sys/stdtypes.h
go500gw.o: /usr/include/signal.h /usr/include/sys/signal.h
detach.o: detach.c /usr/include/stdio.h /usr/include/sys/types.h
detach.o: /usr/include/sys/stdtypes.h /usr/include/sys/sysmacros.h
detach.o: /usr/include/sys/file.h /usr/include/sys/types.h
detach.o: /usr/include/sys/fcntlcom.h /usr/include/sys/stdtypes.h
detach.o: /usr/include/sys/stat.h /usr/include/sys/types.h
detach.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
detach.o: /usr/include/sys/ttydev.h /usr/include/sys/ttold.h
detach.o: /usr/include/sys/ioccom.h /usr/include/sys/ttycom.h
detach.o: /usr/include/sys/filio.h /usr/include/sys/ioccom.h
detach.o: /usr/include/sys/sockio.h /usr/include/sys/ioccom.h
detach.o: /usr/include/signal.h /usr/include/sys/signal.h
detach.o: /usr/include/vm/faultcode.h /usr/include/sys/stdtypes.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
