#
#  Makefile for FreeBSD
#
#	@(#)Makefile.FreeBSD	8.1 (Berkeley) 2/26/94

PROG=	sendmail

# define the database format to use for aliases et al.  Can be -DNEWDB (for
# the new BSD database package -- this is preferred) or -DNDBM for the NDBM
# database package.  The old putrescent V7 DBM package is no longer
# supported.
# You can define both NEWDB and NDBM during a transition period; old
# databases are read, but the new format will be used on any rebuilds.  On
# really gnarly systems, you can set this to null; it will crawl like a high
# spiral snail, but it will work.
DBMDEF=	-DNDBM # -DNEWDB

CC	= gcc
CFLAGS	+= -g -fpcc-struct-return -funsigned-char -fno-builtin

# FreeBSD 1.0 RELEASE has uname(2) now. Use -DUSEUNAME in order to use it.
CFLAGS+=-I${.CURDIR} ${DBMDEF} -DMIME -DUSEUNAME

SRCS=	alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
	deliver.c domain.c envelope.c err.c headers.c macro.c main.c map.c \
	mci.c parseaddr.c queue.c readcf.c recipient.c savemail.c srvrsmtp.c \
	stab.c stats.c sysexits.c trace.c udb.c usersmtp.c \
	util.c version.c
DPADD=	
LDADD=	-L/usr/local/lib $(LIBUTIL) -lresolv -lgdbm
#
# FreeBSD 1.0 RELEASE has GNU man and doesn't need preformatted man pages anymore
#	(assuming you consider a slower "man" command a feature)
#
MAN1=	mailq.1 newaliases.1
MAN5=	aliases.5
MAN8=	sendmail.8
MANDIR	= /usr/local/man/man
LINKS=	/usr/sbin/sendmail /usr/bin/newaliases \
	/usr/sbin/sendmail /usr/bin/mailq
BINDIR=	/usr/alt/sbin
BINOWN=	root
BINGRP=	kmem
BINMODE=6555
#DESTDIR	= /usr/alt

beforeinstall:
#	install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
#	    ${DESTDIR}/etc/sendmail.fc
	install -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
	    ${DESTDIR}/var/log/sendmail.st
	install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/sendmail.hf \
	    ${DESTDIR}/usr/share/misc

.include <bsd.prog.mk>
