xref: /titanic_50/usr/src/cmd/sendmail/aux/Makefile (revision a69116193464f859a8b27a2db19ad330ce163a55)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24
25# cmd/sendmail/aux/Makefile
26#
27include		../../Makefile.cmd
28include		../Makefile.cmd
29
30PROG= 		mailstats mconnect vacation mailcompat praliases mailq
31
32LIBPROG=	mail.local smrsh
33
34USRSBINPROG=	etrn makemap editmap
35
36# $(PROG) by default
37CLOBBERFILES=	$(LIBPROG) $(USRSBINPROG)
38
39OBJS= 		$(PROG:%=%.o)
40
41.PARALLEL:	$(OBJS) $(PROG) $(LIBPROG) $(USRSBINPROG)
42
43SRCS= 		$(PROG:%=%.c)
44
45editmap :=	LDLIBS += -lldap
46mail.local :=	LDLIBS += -lsocket -lnsl -lmail -lldap
47mailq :=	LDLIBS += -lsecdb
48mailstats :=	LDLIBS += -lldap
49makemap :=	LDLIBS += -lldap
50mconnect :=	LDLIBS += -lsocket -lnsl
51praliases :=	LDLIBS += -lldap
52smrsh :=	LDLIBS += -lldap
53vacation :=	LDLIBS += -lldap
54$(ROOTBIN)/mailq :=	FILEMODE = 4555
55
56INCPATH=	-I../src -I../db -I../include
57
58ENVDEF=		-DNOT_SENDMAIL
59SUNENVDEF=	-DSUN_EXTENSIONS -DUSE_VENDOR_CF_PATH
60DBMDEF=		-DNDBM -DNEWDB
61
62CPPFLAGS =	$(INCPATH) $(ENVDEF) $(SUNENVDEF) $(DBMDEF) $(CPPFLAGS.sm)
63
64# Nearly every support application provides sleep().  This isn't incompatible
65# with libc, but can be confined to the applications themselves.
66LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
67
68.KEEP_STATE:
69
70all:		$(PROG) $(LIBPROG) $(USRSBINPROG)
71
72convtime.o:	../src/convtime.c
73	$(COMPILE.c) ../src/convtime.c
74	$(POST_PROCESS_O)
75
76vacation:	vacation.o convtime.o rfc2047.o ../libsm/libsm.a
77	$(LINK.c) vacation.o convtime.o rfc2047.o -o $@ $(LDLIBS) \
78		../libsm/libsm.a
79	$(POST_PROCESS)
80
81mail.local:	mail.local.o ../libsmutil/libsmutil.a ../libsm/libsm.a
82	$(LINK.c) mail.local.o -o $@ $(LDLIBS) ../libsmutil/libsmutil.a \
83		../libsm/libsm.a
84	$(POST_PROCESS)
85
86smrsh:	smrsh.o ../libsm/libsm.a
87	$(LINK.c) smrsh.o -o $@ $(LDLIBS) ../libsm/libsm.a
88	$(POST_PROCESS)
89
90makemap:	makemap.o ../libsmutil/libsmutil.a ../libsmdb/libsmdb.a \
91			../db/libdb.a ../libsm/libsm.a
92	$(LINK.c) makemap.o -o $@ $(LDLIBS) ../libsmdb/libsmdb.a \
93		../libsmutil/libsmutil.a ../db/libdb.a ../libsm/libsm.a
94	$(POST_PROCESS)
95
96editmap:	editmap.o ../libsmutil/libsmutil.a ../libsmdb/libsmdb.a \
97			../db/libdb.a ../libsm/libsm.a
98	$(LINK.c) editmap.o -o $@ $(LDLIBS) ../libsmdb/libsmdb.a \
99		../libsmutil/libsmutil.a ../db/libdb.a ../libsm/libsm.a
100	$(POST_PROCESS)
101
102praliases:	praliases.o ../libsmutil/libsmutil.a ../libsmdb/libsmdb.a \
103			../libsm/libsm.a
104	$(LINK.c) praliases.o -o $@ $(LDLIBS) ../libsmdb/libsmdb.a \
105		../libsmutil/libsmutil.a ../db/libdb.a ../libsm/libsm.a
106	$(POST_PROCESS)
107
108mailstats:	mailstats.o ../libsmutil/libsmutil.a ../libsm/libsm.a
109	$(LINK.c) mailstats.o -o $@ $(LDLIBS) ../libsmutil/libsmutil.a \
110		../libsm/libsm.a
111	$(POST_PROCESS)
112
113install: all $(ROOTPROG) $(ROOTLIB)/mail.local $(ROOTLIB)/smrsh \
114	$(ROOTUSRSBIN)/makemap $(ROOTUSRSBIN)/etrn $(ROOTUSRSBIN)/editmap
115
116clean:
117	$(RM) $(OBJS) *.o
118
119lint:		lint_PROG
120
121
122include	../../Makefile.targ
123