xref: /illumos-gate/usr/src/cmd/sendmail/src/Makefile (revision a31148363f598def767ac48c5d82e1572e44b935)
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#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# cmd/sendmail/src/Makefile
27#
28
29PROG=	sendmail
30
31include 	../../Makefile.cmd
32include 	../Makefile.cmd
33
34OBJS= alias.o arpadate.o bf.o collect.o conf.o control.o convtime.o daemon.o \
35	deliver.o domain.o envelope.o err.o headers.o macro.o main.o map.o \
36	mci.o milter.o mime.o parseaddr.o queue.o ratectrl.o readcf.o \
37	recipient.o savemail.o sfsasl.o sm_resolve.o srvrsmtp.o stab.o stats.o \
38	sysexits.o tls.o trace.o udb.o usersmtp.o util.o version.o
39
40SRCS=	$(OBJS:%.o=%.c)
41
42MAPFILES =	$(MAPFILE.INT) $(MAPFILE.NGB)
43LDFLAGS +=	$(MAPFILES:%=-M%)
44
45# EXPORT DELETE START
46CRYPTOLIBS=	-lssl -lcrypto
47# EXPORT DELETE END
48LDLIBS += 	../libsmutil/libsmutil.a ../libsm/libsm.a -lresolv -lsocket \
49		-lnsl ../db/libdb.a -lldap -lsldap -lwrap -lumem \
50		$(CRYPTOLIBS)
51
52INCPATH=	-I. -I../include -I../db
53
54# EXPORT DELETE START
55CRYPTOENVDEF=	-DSTARTTLS
56# EXPORT DELETE END
57ENVDEF=		-DNETINET6 -DTCPWRAPPERS $(CRYPTOENVDEF)
58SUNENVDEF=	-DSUN_EXTENSIONS -DVENDOR_DEFAULT=VENDOR_SUN \
59		-DSUN_INIT_DOMAIN -DSUN_SIMPLIFIED_LDAP -D_FFR_LOCAL_DAEMON \
60		-D_FFR_MAIL_MACRO
61
62CPPFLAGS = 	$(INCPATH) $(ENVDEF) $(SUNENVDEF) $(DBMDEF) $(CPPFLAGS.sm)
63
64FILEMODE= 	2555
65
66ROOTSYMLINKS=	$(ROOTUSRSBIN)/newaliases $(ROOTUSRSBIN)/sendmail
67
68# build rule
69#
70
71.KEEP_STATE:
72all:		$(PROG)
73
74.PARALLEL:	$(OBJS)
75
76$(PROG):	$(OBJS) $(MAPFILES) \
77	../libsmutil/libsmutil.a ../libsm/libsm.a ../db/libdb.a
78	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
79	$(POST_PROCESS)
80
81install:	$(ROOTLIBPROG) $(ROOTSYMLINKS)
82
83$(ROOTSYMLINKS):
84	$(RM) $@; $(SYMLINK) ../lib/sendmail $@
85
86clean:
87	$(RM) $(PROG) $(OBJS)
88
89lint:	lint_SRCS
90
91# EXPORT DELETE START
92EXPORT_SRC:
93	$(RM) Makefile+
94	$(SED) -e "/^# EXPORT DELETE START/,/^# EXPORT DELETE END/d" \
95	    < Makefile > Makefile+
96	$(MV) Makefile+ Makefile
97	$(CHMOD) 444 Makefile
98# EXPORT DELETE END
99
100include		../../Makefile.targ
101