#
# 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.5 (Berkeley) 9/20/88
#
# MH_LCK_BEL	Use 'dot' locks in the spool directory instead of kernel locks
# LACK_FCHOWN	Fake fchown() with chown().
# LACK_FTRUNCATE	Fake ftruncate() with truncate().
# QUOTAFILE	Path name of quota limits file.

DEFS=	-DQUOTAFILE=\"/var/mail/.mail_limit\" -DMH_LCK_BEL
CC=	gcc
CFLAGS=	$(DEFS) -O -I. -I../src
ALL=	mail
SRCS=	binmail.c flock.c mktemp.c mhlock.c
OBJS=	binmail.o flock.o mktemp.o mhlock.o
LIBS=	-L/usr/local/lib -lpasswd -lresolv -lsocket -lnsl # -lBSD
MAN=	binmail.1

all: ${ALL}

mail: ${OBJS}
	${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS}

clean:
	rm -f core ${ALL} ${OBJS} 

cleandir: clean
	rm -f tags .depend

depend: ${SRCS}
	mkdep -p ${CFLAGS} ${SRCS}

install: ${ALL} ${MAN}
	install -o -f ${DESTDIR}/bin -u root -g bin mail
	chmod 4755 ${DESTDIR}/bin/mail
	install -o -f ${DESTDIR}/usr/man/man1 -u bin -g bin binmail.1
	(cd ${DESTDIR}/usr/man/man1; chmod 444 ${MAN})
# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

binmail: pathnames.h
flock: flock.h

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
