#
# 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: Makefile.in,v 1.16 2000/07/01 18:04:21 wuftpd Exp $
#

#
# Generic Makefile for autoconf'ed build
#

CC=sh4-linux-gcc
 
#WNOERROR=-Werror
#WARNINGS=$(WNOERROR) -Wall -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes 

CFLAGS=$(WARNINGS) -ml -m4 -g -O2
LDFLAGS=
YACC=bison -y
LIBS= -lcrypt -lnsl -lresolv -lsupport

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

SRCS   = ${UTIL_OBJS} ftpd.c ftpcmd.c glob.c logwtmp.c popen.c access.c \
	extensions.c realpath.c acl.c private.c authenticate.c conversions.c \
	rdservers.c paths.c hostacc.c sigfix.c auth.c routevector.c \
	restrict.c domain.c wu_fnmatch.c timeout.c getpwnam.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 \
	rdservers.o paths.o hostacc.o sigfix.o auth.o routevector.o \
	restrict.o domain.o wu_fnmatch.o timeout.o getpwnam.o

.c.o:
	$(CC) $(CFLAGS) -I.. -I../support -c -o $@ $<

all: ftpd ftpcount ftpshut ftprestart ckconfig

${OBJS}: config.h ../config.h pathnames.h

ftpcmd.c: config.h ../config.h pathnames.h ftpcmd.y
	$(YACC) ftpcmd.y
	mv -f y.tab.c ftpcmd.c

ftpcount: ${UTIL_OBJS} ftpcount.o 
	$(CC) $(CFLAGS) -o $@ ${UTIL_OBJS} ftpcount.o -L../support $(LIBS)

ftpshut: ${UTIL_OBJS} ftpshut.o rdservers.o 
	$(CC) $(CFLAGS) -o $@ ${UTIL_OBJS} ftpshut.o rdservers.o -L../support $(LIBS)

ftprestart: ${UTIL_OBJS} ftprestart.o rdservers.o 
	$(CC) $(CFLAGS) -o $@ ${UTIL_OBJS} ftprestart.o rdservers.o -L../support $(LIBS)

ckconfig: ${UTIL_OBJS} ckconfig.o rdservers.o
	$(CC) $(CFLAGS) -o $@ ${UTIL_OBJS} ckconfig.o rdservers.o -L../support $(LIBS)

ftpd: ${OBJS}
	$(CC) $(CFLAGS) -o $@ ${OBJS} -L../support $(LIBS)

vers.c: ftpcmd.c
	sh newvers.sh

clean:
	rm -f ${OBJS} ftpd ftpcmd.c ftpshut ftpshut.o 
	rm -f ftprestart ftprestart.o ftpcount ftpcount.o
	rm -f core index index.o ckconfig ckconfig.o vers.c

distclean: clean
	rm -f config.h Makefile edit pathnames.h
