#
# Copyright (c) 1988 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of California, Berkeley.  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'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	@(#)Makefile	5.8 (Berkeley) 9/22/88
#
CFLAGS=	-O
LIBC=	/lib/libc.a
SRCS=	ftpd.c ftpcmd.c glob.c logwtmp.c popen.c vers.c traceroute.c
OBJS=	ftpd.o ftpcmd.o glob.o logwtmp.o popen.o vers.o traceroute.o
MAN=	ftpd.0

all:  ftpd

ftpd: ${OBJS} ${LIBC} conf.h
	${CC} -o $@ ${OBJS} -lresolv

conf.h:
	@echo "Copy conf.h-dist to conf.h, and EDIT THIS FILE."
	@echo "then say make again."
	@exit -1

vers.o: ftpd.c ftpcmd.y
	sh newvers.sh
	${CC} ${CFLAGS} -c vers.c

clean:
	rm -f ${OBJS} ftpd core ftpcmd.c

cleandir: clean
	rm -f ${MAN} tags .depend

depend: ${SRCS}
	maketd -a ${SRCS}

install:
	install -s -o bin -g bin -m 755 ftpd ${DESTDIR}/etc/ftpd

lint: ${SRCS}
	lint ${CFLAGS} ${SRCS}

tags: ${SRCS}
	ctags ${SRCS}
# DO NOT DELETE THIS LINE - make depend DEPENDS ON IT
I=/usr/include
S=/usr/include/sys

conf.o: conf.h

ftpcmd.o: $I/arpa/ftp.h $I/arpa/telnet.h $I/ctype.h $I/machine/setjmp.h \
	$I/netinet/in.h $I/pwd.h $I/setjmp.h $I/signal.h $I/stdio.h \
	$S/signal.h $S/socket.h $S/stdtypes.h $S/sysmacros.h $S/types.h \
	$Slog.h $I/vm/faultcode.h conf.h ftpcmd.y

ftpd.o: $I/arpa/ftp.h $I/arpa/inet.h $I/arpa/telnet.h $I/ctype.h $I/dirent.h \
	$I/errno.h $I/machine/param.h $I/machine/setjmp.h $I/netdb.h \
	$I/netinet/in.h $I/pwd.h $I/setjmp.h $I/signal.h $I/stdio.h \
	$I/strings.h $S/dirent.h $S/errno.h $S/fcntlcom.h $S/file.h \
	$S/filio.h $S/ioccom.h $S/ioctl.h $S/param.h $S/signal.h $S/socket.h \
	$S/sockio.h $S/stat.h $S/stdtypes.h $S/sysmacros.h $S/ttold.h \
	$S/ttychars.h $S/ttycom.h $S/ttydev.h $S/types.h $S/wait.h $Slog.h \
	$I/vm/faultcode.h conf.h ftpd.c

glob.o: $I/errno.h $I/machine/param.h $I/pwd.h $I/stdio.h $S/dir.h $S/errno.h \
	$S/param.h $S/signal.h $S/stat.h $S/stdtypes.h $S/sysmacros.h \
	$S/types.h $I/vm/faultcode.h glob.c

logwtmp.o: $S/fcntlcom.h $S/file.h $S/stat.h $S/stdtypes.h $S/sysmacros.h \
	$S/time.h $S/types.h $I/time.h $I/utmp.h logwtmp.c

popen.o: $I/stdio.h $S/signal.h $S/stdtypes.h $S/sysmacros.h $S/types.h \
	$I/vm/faultcode.h popen.c

strtok.o: strtok.c

traceroute.o: conf.h traceroute.c

vers.o: vers.c

# *** Do not add anything here - It will go away. ***
