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