MAKE=make

# Uncomment next line if your signal call is reset when caught.
#SIGNAL=-DOLD_SIGNAL

# Uncomment next line if your compiler complains about ANSI style constructs.
#COMPILER=-DOLD_COMPILER

# Uncomment if your local YP/NIS server is dodgy (ie. server hangs after the
# 'connection' message and suddenly comes back to life after ~60 seconds
#YP=-DMESSED_UP_YP

# Uncomment if ctime() and time() functions aren't defined in your header
# files (unlikely) - if you get errors about prototypes for those functions
#CTIME=-DBUGGY_CTIME

# Next line is for debugging access lists etc.
# Define if you want to check them.
#DEBUG=-DDEBUG -g

# Next line is for running ftpd through a debugger. 
# Define and the process wont abort and background itself.
#FORK=-DNO_FORK

#Some machines will need the socket library for the 'auth' option
#EXTRA_LIBS = -lsocket
EXTRA_LIBS = -ldl

# Uncomment the following line if compiling on Solaris
#CC=/usr/ucb/cc

# Uncomment if you have gcc (on AIX, better off using 'cc')
CC=gcc

# Set optimisation level
#OPTIMISE=-g
OPTIMISE=-O

# Define any extra options here.
COPTS=

#
#
# You shouldn't have to touch anything below!
#
#

CFLAGS=	${OPTIMISE} -I. ${DEBUG} ${SIGNAL} ${COMPILER} ${COPTS} ${YP} ${CTIME} \
	${FORK}
#LIBC= /lib/libc.a
#LIBC=	/lib/libsys_s.a
SRCS=	args.c ftpd.c ftpcmd.c glob.c popen.c\
	strtok.c strpbrk.c valid.c message.c\
	list.c auth.c
OBJS=	args.o ftpd.o ftpcmd.o glob.o popen.o\
	strtok.o strpbrk.o valid.o message.o\
	list.o auth.o
MAN=	ftpd.8

all: ftpd

docs:
	nroff -man doc/${MAN} > doc/ftpd.cat

VERSION = `cat /mud2/zips/version.h | cut -d\. -f2-3 | cut -d\" -f1`

tidy:
	(cd ..; tar -cvf ftpdt ftpd; gzip -9v ftpdt; rm -rf ftpd)

backup:
	(cd ..; tar -cvf ftpdt ftpd; cd ftpd)

ftpd: ${OBJS} 
	${CC} -o $@ ${OBJS} ${EXTRA_LIBS}

clean:
	rm -f ${OBJS} ftpd core doc/ftpd.cat

# Dependencies

args.c: ftpd.h
ftpd.c: ftpd.h
ftpcmd.c: ftpd.h
valid.c: ftpd.h
glob.c: ftpd.h
list.c: ftpd.h
message.c: ftpd.h
ftpd.h: version.h
auth.c: ftpd.h

