xref: /freebsd/usr.sbin/sendmail/Makefile (revision 136fb141c6527f7a022d0528ac9dca78b5f9989e)
1#	@(#)Makefile	8.8 (Berkeley) 3/28/97
2# $FreeBSD$
3
4.include <bsd.own.mk>
5
6SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
7SMDIR=	${SENDMAIL_DIR}/src
8.PATH: ${SMDIR}
9
10BINDIR=	/usr/libexec/sendmail
11
12PROG=	sendmail
13MAN=	mailq.1 newaliases.1 aliases.5 sendmail.8
14MLINKS+=sendmail.8 hoststat.8
15MLINKS+=sendmail.8 purgestat.8
16SRCS=	alias.c arpadate.c bf.c collect.c conf.c control.c \
17	convtime.c daemon.c deliver.c domain.c envelope.c err.c headers.c \
18	macro.c main.c map.c mci.c milter.c mime.c parseaddr.c queue.c \
19	ratectrl.c readcf.c recipient.c savemail.c sasl.c sfsasl.c \
20	shmticklib.c sm_resolve.c srvrsmtp.c stab.c stats.c sysexits.c \
21	timers.c tls.c trace.c udb.c usersmtp.c util.c version.c
22BINOWN=	root
23BINGRP=	smmsp
24.ifdef SENDMAIL_SET_USER_ID
25BINMODE=4555
26.else
27BINMODE=2555
28.endif
29
30# Define the database format to use for aliases et al.
31DBMDEF=	-DNEWDB
32# If you don't want NIS alias/map support, comment out this line
33.if ${MK_NIS} != "no"
34NIS=	-DNIS
35.endif
36# Map extensions
37MAPS=	-DMAP_REGEX -DDNSMAP
38
39CFLAGS+= -I${SMDIR} -I${SENDMAIL_DIR}/include -I.
40CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS ${MAPS}
41
42.if ${MK_INET6_SUPPORT} != "no"
43CFLAGS+= -DNETINET6
44.endif
45
46WARNS?=	1
47
48.if ${CC:T:Mclang} == "clang"
49# Unfortunately, clang gives warnings about sendmail code that cannot
50# be turned off yet.  Since this is contrib code, and we don't really
51# care about the warnings, just make them non-fatal for now.
52NO_WERROR=
53.endif
54
55DPADD=	${LIBUTIL} ${LIBWRAP}
56LDADD=	-lutil -lwrap
57
58LIBSMDIR=	${.OBJDIR}/../../lib/libsm
59LIBSM=		${LIBSMDIR}/libsm.a
60
61LIBSMUTILDIR=	${.OBJDIR}/../../lib/libsmutil
62LIBSMUTIL=	${LIBSMUTILDIR}/libsmutil.a
63
64DPADD+=	${LIBSMUTIL} ${LIBSM}
65LDADD+=	${LIBSMUTIL} ${LIBSM}
66
67SRCS+=	sm_os.h
68CLEANFILES+=sm_os.h
69
70.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
71# STARTTLS support
72CFLAGS+=	-DSTARTTLS -D_FFR_TLS_1
73DPADD+=		${LIBSSL} ${LIBCRYPTO}
74LDADD+=		-lssl -lcrypto
75.endif
76
77# User customizations to the sendmail build environment
78CFLAGS+=${SENDMAIL_CFLAGS}
79DPADD+=${SENDMAIL_DPADD}
80LDADD+=${SENDMAIL_LDADD}
81LDFLAGS+=${SENDMAIL_LDFLAGS}
82
83sm_os.h:
84	ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
85
86.include <bsd.prog.mk>
87