xref: /illumos-gate/usr/src/cmd/sendmail/src/Makefile (revision 590e0b5da08d7261161e979afc4bf4aa0f543574)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22# Copyright (c) 2011 Gary Mills
23
24#
25# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/sendmail/src/Makefile
29#
30
31PROG=	sendmail
32
33include		../../Makefile.cmd
34include		../Makefile.cmd
35
36OBJS= alias.o arpadate.o bf.o collect.o conf.o control.o convtime.o daemon.o \
37	deliver.o domain.o envelope.o err.o headers.o macro.o main.o map.o \
38	mci.o milter.o mime.o parseaddr.o queue.o ratectrl.o readcf.o \
39	recipient.o sasl.o savemail.o sfsasl.o sm_resolve.o srvrsmtp.o stab.o \
40	stats.o sysexits.o tls.o trace.o udb.o usersmtp.o util.o version.o
41
42SRCS=	$(OBJS:%.o=%.c)
43
44MAPFILES =	$(MAPFILE.INT) $(MAPFILE.NGB)
45LDFLAGS +=	$(MAPFILES:%=-Wl,-M%)
46
47LDLIBS +=	../libsmutil/libsmutil.a ../libsm/libsm.a -lresolv -lsocket \
48		-lnsl ../db/libdb.a -lldap -lsldap -lwrap -lumem \
49		-lssl -lcrypto -lsasl
50NATIVE_LIBS +=	libssl.so libcrypto.so
51
52INCPATH=	-I. -I../include -I../db
53
54ENVDEF=		-DNETINET6 -DTCPWRAPPERS -DSTARTTLS -DSASL=20115
55SUNENVDEF=	-DSUN_EXTENSIONS -DVENDOR_DEFAULT=VENDOR_SUN \
56		-DSUN_INIT_DOMAIN -DSUN_SIMPLIFIED_LDAP -D_FFR_LOCAL_DAEMON \
57		-D_FFR_MAIL_MACRO
58
59CPPFLAGS =	$(INCPATH) $(ENVDEF) $(SUNENVDEF) $(DBMDEF) $(CPPFLAGS.sm)
60
61# The tls.c file is not ported to the OpenSSL 3.x API yet and so we need to
62# make sure the deprecated 1.x API is fully available for it.  Once the tls.c
63# file is adapted for OpenSSL 3.x this should be updated or removed.
64# See also https://www.illumos.org/issues/16918
65CPPFLAGS +=	-DOPENSSL_API_COMPAT=10101
66
67FILEMODE=	2555
68
69ROOTSYMLINKS=	$(ROOTLIBSMTPSM)/newaliases
70
71# build rule
72#
73
74.KEEP_STATE:
75all:		$(PROG)
76
77.PARALLEL:	$(OBJS)
78
79$(PROG):	$(OBJS) $(MAPFILES) \
80	../libsmutil/libsmutil.a ../libsm/libsm.a ../db/libdb.a
81	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
82	$(POST_PROCESS)
83
84install:	$(ROOTLIBSMTPSM)/sendmail $(ROOTSYMLINKS)
85
86$(ROOTSYMLINKS):
87	$(RM) $@; $(SYMLINK) sendmail $@
88
89clean:
90	$(RM) $(PROG) $(OBJS)
91
92include		../../Makefile.targ
93