#
# Copyright (c) 1999,2000 WU-FTPD Development Group.
# All rights reserved.
# 
# Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994 
#    The Regents of the University of California.  
# Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.  
# Portions Copyright (c) 1989 Massachusetts Institute of Technology.  
# Portions Copyright (c) 1998 Sendmail, Inc.
# Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman.  
# Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.  
# Portions Copyright (C) 1991, 1992, 1993, 1994, 1995 1996, 1997 
#    Free Software Foundation, Inc.  
# Portions Copyright (c) 1997 Stan Barber.  
# Portions Copyright (c) 1997 Kent Landfield.
# 
# Use and distribution of this software and its source code are governed by 
# the terms and conditions of the WU-FTPD Software License ("LICENSE").
# 
# If you did not receive a copy of the license, it may be obtained online at
# http://www.wu-ftpd.org/license.html.
# 
# $Id: common,v 1.16 2000/07/01 18:57:50 wuftpd Exp $
#

UTIL_SRC  = COPYRIGHT.c vers.c
UTIL_OBJS = COPYRIGHT.o vers.o


SRCS   = ${UTIL_SRC} ftpd.c ftpcmd.c glob.c logwtmp.c popen.c access.c \
         extensions.c realpath.c acl.c private.c authenticate.c conversions.c \
         hostacc.c rdservers.c paths.c sigfix.c routevector.c restrict.c \
         domain.c wu_fnmatch.c timeout.c
OBJS   = ${UTIL_OBJS} ftpd.o ftpcmd.o glob.o logwtmp.o popen.o access.o \
         extensions.o realpath.o acl.o private.o authenticate.o conversions.o \
         hostacc.o rdservers.o paths.o sigfix.o routevector.o restrict.o \
         domain.o wu_fnmatch.o timeout.o

all: ftpd ftpcount ftpshut ftprestart ckconfig privatepw

ftpcount: ${UTIL_OBJS} ftpcount.o ../support/libsupport.a
	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ftpcount.o ${XLIBS}

ftpshut: ${UTIL_OBJS} ftpshut.o rdservers.o ../support/libsupport.a
	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ftpshut.o rdservers.o ${XLIBS}

ftprestart: ${UTIL_OBJS} ftprestart.o rdservers.o ../support/libsupport.a
	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ftprestart.o rdservers.o ${XLIBS}

ftpd: ${OBJS} ${XOBJS} ../support/libsupport.a
	${CC} ${LFLAGS} -o $@ ${OBJS} ${XOBJS} ${XLIBS}

ckconfig: ${UTIL_OBJS} ckconfig.o rdservers.o 
	${CC} ${LFLAGS} -o $@ ${UTIL_OBJS} ckconfig.o rdservers.o ${XLIBS}

privatepw: ${UTIL_OBJS} ../util/privatepw/privatepw.c
	${CC} ${CFLAGS} ${LFLAGS} -o $@ ${UTIL_OBJS} ../util/privatepw/privatepw.c ${XLIBS}

test.loadavg: test.loadavg.c loadavg.o

hard.loop: hard.loop.c

clean:
	rm -f ${OBJS} ftpd ftpcmd.c ftpshut ftpshut.o 
	rm -f ftprestart ftprestart.o ftpcount ftpcount.o privatepw
	rm -f core ckconfig ckconfig.o *~ makefiles/*~
	rm -f config/*~
	rm -f test.loadavg hard.loop

cleandir: clean
	rm -f tags .depend
	rm -f vers.c edit

depend: ${SRCS} ${XSRCS}
	${MKDEP} ${CFLAGS} ${SRCS} ${XSRCS}

lint: ${SRCS} ${XSRCS}
	lint ${CFLAGS} ${LINTFLAGS} ${SRCS} ${XSRCS}

tags: ${SRCS} ${XSRCS}
	ctags ${SRCS} ${XSRCS}

COPYRIGHT.o: COPYRIGHT.c 

access.o: access.c config.h pathnames.h extensions.h wu_fnmatch.h ../config.h

acl.o: acl.c config.h pathnames.h extensions.h ../config.h

auth.o: auth.c config.h ../config.h

authenticate.o: authenticate.c config.h ../support/authuser.h authenticate.h ../config.h

ckconfig.o: ckconfig.c config.h pathnames.h ../config.h

conversions.o: conversions.c config.h conversions.h extensions.h pathnames.h ../config.h

domain.o: domain.c config.h extensions.h ../config.h

extensions.o: extensions.c config.h pathnames.h extensions.h wu_fnmatch.h ../support/ftw.h ../config.h ../support/ftp.h

ftpcmd.c: ftpcmd.y

ftpcmd.o: ftpcmd.c config.h extensions.h pathnames.h ../config.h ../support/ftp.h

ftpcount.o: ftpcount.c config.h pathnames.h extensions.h ../config.h

ftpd.o: ftpd.c config.h conversions.h extensions.h pathnames.h ../config.h ../support/ftp.h

ftpshut.o: ftpshut.c config.h pathnames.h ../config.h

ftprestart.o: ftprestart.c config.h pathnames.h ../config.h

glob.o: glob.c config.h ../config.h

hostacc.o: hostacc.c config.h hostacc.h ../config.h pathnames.h

loadavg.o: loadavg.h

logwtmp.o: logwtmp.c config.h pathnames.h ../config.h

paths.o: paths.c config.h pathnames.h ../config.h

popen.o: popen.c config.h ../config.h

private.o: private.c config.h pathnames.h extensions.h ../config.h

rdservers.o: rdservers.c config.h ../config.h

realpath.o: realpath.c config.h ../config.h

restrict.o: restrict.c config.h ../config.h

routevector.o: routevector.c config.h pathnames.h extensions.h ../config.h ../support/ftp.h

sigfix.o: sigfix.c config.h ../config.h

timeout.o: timeout.c config.h ../config.h extensions.h

vers.c: ftpcmd.y newvers.sh
	sh newvers.sh

vers.o: vers.c

wu_fnmatch.o: wu_fnmatch.c wu_fnmatch.h
