xref: /titanic_52/usr/src/cmd/mail/Makefile (revision 67e3a03ed4a2813074d36330f062ed6e593a4937)
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 2007 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29
30BINPROG=	mail
31
32PROG= 	       $(BINPROG)
33
34GREP=		grep
35
36include ../Makefile.cmd
37
38CLOBBERFILES=	$(PROG)
39CLEANFILES=	$(MAILOBJS)
40
41MAILOBJS= 	add_recip.o cat.o ckdlivopts.o \
42		cksaved.o clr_hinfo.o copyback.o copylet.o \
43		copymt.o createmf.o del_recipl.o Dout.o  delete.o \
44		done.o doopen.o dumpaff.o dumprcv.o \
45		errmsg.o gendeliv.o getarg.o getcomment.o \
46		gethead.o goback.o init.o \
47		isheader.o isit.o islocal.o istext.o legal.o \
48		lock.o  main.o mkdead.o mta_ercode.o \
49		new_recipl.o parse.o pckaffspot.o pckrcvspot.o \
50		pickFrom.o pipletr.o poplist.o printhdr.o printmail.o \
51		pushlist.o savehdrs.o sel_disp.o  sendlist.o \
52		sendmail.o  setsig.o \
53		stamp.o Tout.o
54
55MAILSRC=	 $(MAILOBJS:%.o=%.c)
56
57CPROG=		mail
58CPROGSRC= 	$(CPROG:%=_%.c)
59
60# ROOT directories
61ROOTMAILD=	$(ROOTLIB)/mail
62ROOTINC=	$(ROOT)/usr/include
63
64# installed modules
65ROOTBINPROG=	$(BINPROG:%=$(ROOTBIN)/%)
66
67ROOTSYMLINKS=	$(ROOTBIN)/rmail
68
69
70EDITPATH= \
71	sed -e 's!REAL_PATH!/usr/bin!g' \
72	    -e 's!USR_SHARE_LIB!/usr/share/lib!g' \
73	    -e 's!VAR_MAIL!/var/mail!g' < $? > $@
74
75CPPFLAGS =	-DSVR4 -I. $(CPPFLAGS.master)
76
77LDLIBS +=	-lmail -lsocket
78
79# mail defines its own delete() - reduce symbols to locals to remove name clash.
80LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
81
82# conditional assignments
83#
84all:=		TARGET= all
85install:=	TARGET= install
86clean:=		TARGET= clean
87clobber:=	TARGET= clobber
88lint:=		TARGET= lint
89
90# file modes, owners and groups for the install target
91#
92
93
94$(ROOTBIN)/mail :=	FILEMODE =	02511
95$(ROOTBIN)/mail :=	GROUP =	mail
96
97
98# install rules
99$(ROOTINC)/% : %
100	$(INS.file)
101
102.KEEP_STATE:
103
104.PARALLEL: $(MAILOBJS) $(OBJS)
105
106all:		$(PROG)
107
108mail: 		$(MAILOBJS)
109	$(LINK.c) -o $@ $(MAILOBJS) $(LDLIBS)
110	$(POST_PROCESS)
111
112install: all .WAIT $(ROOTBINPROG) $(ROOTSYMLINKS)
113
114# ROOTSYMLINKS
115#
116$(ROOTBIN)/rmail:
117	$(RM) $@; $(SYMLINK) mail $@
118
119lint:
120	$(LINT.c) $(MAILSRC)
121
122clean:
123	$(RM) $(OBJS) $(MAILOBJS)
124
125clobber:
126	$(RM) $(OBJS) $(MAILOBJS) mail
127