#
# Derived from Berkeley ftp code.  Those parts are:
# 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.6 (Berkeley) 6/29/88
#

# You must #define WAIS to include WAIS support, and uncomment the WAIS 
# lines.  See the comment in main.c

P_BINARIES= UNDEFINED
OWNER   = pfs
GROUP   = pfs
INSTALL = install

CC      = gcc
CFLAGS  = -g
F_CC	= ${CFLAGS} -c 
F_CCL   = $(CFLAGS)
F_CPP	= ${P_INC} ${MACHDEF}


# For Kerberos.
K_INC   =
KRB_LIBS=

MAKE	= make

PASTHRU = P_BINARIES=${P_BINARIES} INSTALL="${INSTALL}" OWNER=${OWNER} \
	  GROUP=${GROUP} CC=${CC} F_CC="${F_CC}" F_CCL="${F_CCL}" \
	  K_INC="${K_INC}" MAKE=${MAKE} KRB_LIBS="${KRB_LIBS}" LIBS="${LIBS}" \
	  MACHDEF="${MACHDEF}"

P_INC    = -I../../include 

PFS_LIB	= ../../lib/pfs/libpfs.a
FIL_LIB = ../../lib/filters/libfilter.a  
CMP_LIB = ../../lib/pcompat/libpcompat.a

#WAIS_LIBS= wais/libwais.a -lm
WAIS_LIBS =
#WAIS_TARGETS = wais.dir wais/libwais.a
WAIS_TARGETS = 

CFILES    = cmds.c ftp.c main.c pclose.c aftpget.c ruserpass.c gopherget.c
OBJECTS    = cmds.o ftp.o main.o pclose.o aftpget.o ruserpass.o gopherget.o
CODE    = ${CFILES} Makefile

all: vcache

vcache:	${OBJECTS} ${PFS_LIB} ${FIL_LIB} ${WAIS_TARGETS}
	${CC} ${F_CCL} -o $@ ${OBJECTS} ${PFS_LIB} ${FIL_LIB} ${WAIS_LIBS} ${LIBS}

wais.dir:
	cd wais ; \
	${MAKE} libwais.a



install:
	${INSTALL} -o ${OWNER} -g ${GROUP} -m 755 vcache ${P_BINARIES}/vcache

clean: 
	rm -f ${OBJECTS} core *~ tags TAGS vcache

hide:
	-mkdir .hide
	-mv -f ${OBJECTS} core *~ tags TAGS vcache .hide 

unhide:
	-mv .hide/* .hide/.??* .
	-rmdir .hide


${OBJECTS}:
	${CC} ${F_CC} ${F_CPP} $*.c




# Dependencies
cmds.o : ftp_var.h \
  ../../include/pmachine.h 
ftp.o : ftp_var.h \
  ../../include/pcompat.h \
  ../../include/pfs.h ../../include/ardp.h ../../include/list_macros.h ../../include/pmachine.h 
main.o : \
  ftp_var.h \
  ../../include/pfs.h ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pcompat.h 
pclose.o : \
  ../../include/pmachine.h 
aftpget.o : ftp_var.h \
  ../../include/pfs.h ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/perrno.h ../../include/pcompat.h ../../include/pmachine.h 
ruserpass.o : \
  ftp_var.h 
gopherget.o : \
  ../../include/pfs.h ../../include/ardp.h \
  ../../include/list_macros.h 
