# $Id: Makefile.in,v 1.1 1998-11-16 16:43:36 ghudson Exp $

SHELL=/bin/sh
VPATH=@srcdir@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
mandir=@mandir@

CC=@CC@
DEFS=@DEFS@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@AFS_LIBS@ @LIBS@ -lcom_err
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}

COBJS=		util.o delete_errs.o errors.o
POBJS=		directories.o pattern.o shell_regexp.o stack.o
OBJS=		${COBJS} ${POBJS} delete.o undelete.o expunge.o lsdel.o col.o
DELETEOBJS= 	delete.o ${COBJS}
UNDELETEOBJS= 	undelete.o ${POBJS} ${COBJS}
EXPUNGEOBJS= 	expunge.o col.o ${POBJS} ${COBJS}
LSDELOBJS= 	lsdel.o col.o ${POBJS} ${COBJS}

PROGS=		delete undelete expunge lsdel

all: ${PROGS}

delete: ${DELETEOBJS}
	${CC} ${LDFLAGS} -o $@ ${DELETEOBJS} ${LIBS}

undelete: ${UNDELETEOBJS}
	${CC} ${LDFLAGS} -o $@ ${UNDELETEOBJS} ${LIBS}

expunge: ${EXPUNGEOBJS}
	${CC} ${LDFLAGS} -o $@ ${EXPUNGEOBJS} ${LIBS}

lsdel: ${LSDELOBJS}
	${CC} ${LDFLAGS} -o $@ ${LSDELOBJS} ${LIBS}

delete_errs.h delete_errs.c:
	compile_et ${srcdir}/delete_errs.et

.c.o:
	${CC} -c ${ALL_CFLAGS} $<

check:

install:
	${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
	${INSTALL_PROGRAM} delete ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} undelete ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} expunge ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} lsdel ${DESTDIR}${bindir}
	rm -f ${DESTDIR}${bindir}/purge
	ln -s expunge ${DESTDIR}${bindir}/purge
	${INSTALL} -m 444 ${srcdir}/man1/delete.1 ${DESTDIR}${mandir}/man1
	${INSTALL} -m 444 ${srcdir}/man1/undelete.1 ${DESTDIR}${mandir}/man1
	${INSTALL} -m 444 ${srcdir}/man1/expunge.1 ${DESTDIR}${mandir}/man1
	${INSTALL} -m 444 ${srcdir}/man1/lsdel.1 ${DESTDIR}${mandir}/man1
	${INSTALL} -m 444 ${srcdir}/man1/purge.1 ${DESTDIR}${mandir}/man1

clean:
	rm -f ${PROGS} ${OBJS}

distclean: clean
	rm -f config.cache config.log config.status Makefile

col.o: col.c errors.h mit-copying.h delete_errs.h col.h
delete.o: delete.c errors.h mit-copying.h delete_errs.h util.h delete.h
directories.o: directories.c delete_errs.h util.h mit-copying.h \
	directories.h errors.h
errors.o: errors.c delete_errs.h mit-copying.h
expunge.o: expunge.c col.h mit-copying.h util.h directories.h \
	pattern.h expunge.h shell_regexp.h delete_errs.h errors.h
lsdel.o: lsdel.c col.h mit-copying.h util.h directories.h pattern.h \
	lsdel.h shell_regexp.h delete_errs.h errors.h
pattern.o: pattern.c pattern.h mit-copying.h util.h directories.h \
	undelete.h shell_regexp.h delete_errs.h errors.h stack.h
shell_regexp.o: shell_regexp.c shell_regexp.h mit-copying.h \
	delete_errs.h errors.h
stack.o: stack.c stack.h mit-copying.h delete_errs.h errors.h util.h
undelete.o: undelete.c delete_errs.h pattern.h mit-copying.h util.h \
	directories.h undelete.h shell_regexp.h errors.h
util.o: util.c delete_errs.h util.h mit-copying.h directories.h \
	errors.h
