xref: /onnv-gate/usr/src/cmd/mail/Makefile (revision 10207:87c40ea3fc4b)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
54271Srie# Common Development and Distribution License (the "License").
64271Srie# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
220Sstevel@tonic-gate#
23*10207SJames.McPherson@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate# Use is subject to license terms.
250Sstevel@tonic-gate#
260Sstevel@tonic-gate
270Sstevel@tonic-gate
280Sstevel@tonic-gateBINPROG=	mail
290Sstevel@tonic-gate
300Sstevel@tonic-gatePROG= 	       $(BINPROG)
310Sstevel@tonic-gate
320Sstevel@tonic-gateGREP=		grep
330Sstevel@tonic-gate
340Sstevel@tonic-gateinclude ../Makefile.cmd
350Sstevel@tonic-gate
360Sstevel@tonic-gateCLOBBERFILES=	$(PROG)
370Sstevel@tonic-gateCLEANFILES=	$(MAILOBJS)
380Sstevel@tonic-gate
390Sstevel@tonic-gateMAILOBJS= 	add_recip.o cat.o ckdlivopts.o \
400Sstevel@tonic-gate		cksaved.o clr_hinfo.o copyback.o copylet.o \
410Sstevel@tonic-gate		copymt.o createmf.o del_recipl.o Dout.o  delete.o \
420Sstevel@tonic-gate		done.o doopen.o dumpaff.o dumprcv.o \
430Sstevel@tonic-gate		errmsg.o gendeliv.o getarg.o getcomment.o \
440Sstevel@tonic-gate		gethead.o goback.o init.o \
450Sstevel@tonic-gate		isheader.o isit.o islocal.o istext.o legal.o \
460Sstevel@tonic-gate		lock.o  main.o mkdead.o mta_ercode.o \
470Sstevel@tonic-gate		new_recipl.o parse.o pckaffspot.o pckrcvspot.o \
480Sstevel@tonic-gate		pickFrom.o pipletr.o poplist.o printhdr.o printmail.o \
490Sstevel@tonic-gate		pushlist.o savehdrs.o sel_disp.o  sendlist.o \
500Sstevel@tonic-gate		sendmail.o  setsig.o \
51373Sceastha		stamp.o Tout.o
520Sstevel@tonic-gate
530Sstevel@tonic-gateMAILSRC=	 $(MAILOBJS:%.o=%.c)
540Sstevel@tonic-gate
550Sstevel@tonic-gateCPROG=		mail
560Sstevel@tonic-gateCPROGSRC= 	$(CPROG:%=_%.c)
570Sstevel@tonic-gate
580Sstevel@tonic-gate# ROOT directories
590Sstevel@tonic-gateROOTMAILD=	$(ROOTLIB)/mail
600Sstevel@tonic-gateROOTINC=	$(ROOT)/usr/include
610Sstevel@tonic-gate
620Sstevel@tonic-gate# installed modules
630Sstevel@tonic-gateROOTBINPROG=	$(BINPROG:%=$(ROOTBIN)/%)
640Sstevel@tonic-gate
650Sstevel@tonic-gateROOTSYMLINKS=	$(ROOTBIN)/rmail
660Sstevel@tonic-gate
670Sstevel@tonic-gate
680Sstevel@tonic-gateEDITPATH= \
690Sstevel@tonic-gate	sed -e 's!REAL_PATH!/usr/bin!g' \
700Sstevel@tonic-gate	    -e 's!USR_SHARE_LIB!/usr/share/lib!g' \
710Sstevel@tonic-gate	    -e 's!VAR_MAIL!/var/mail!g' < $? > $@
720Sstevel@tonic-gate
730Sstevel@tonic-gateCPPFLAGS =	-DSVR4 -I. $(CPPFLAGS.master)
740Sstevel@tonic-gate
750Sstevel@tonic-gateLDLIBS +=	-lmail -lsocket
760Sstevel@tonic-gate
774271Srie# mail defines its own delete() - reduce symbols to locals to remove name clash.
784271SrieLDFLAGS +=	$(MAPFILE.NGB:%=-M%)
794271Srie
800Sstevel@tonic-gate# conditional assignments
810Sstevel@tonic-gate#
820Sstevel@tonic-gateall:=		TARGET= all
830Sstevel@tonic-gateinstall:=	TARGET= install
840Sstevel@tonic-gateclean:=		TARGET= clean
850Sstevel@tonic-gateclobber:=	TARGET= clobber
860Sstevel@tonic-gatelint:=		TARGET= lint
870Sstevel@tonic-gate
880Sstevel@tonic-gate# file modes, owners and groups for the install target
890Sstevel@tonic-gate#
900Sstevel@tonic-gate
910Sstevel@tonic-gate
920Sstevel@tonic-gate$(ROOTBIN)/mail :=	FILEMODE =	02511
930Sstevel@tonic-gate
940Sstevel@tonic-gate
950Sstevel@tonic-gate# install rules
960Sstevel@tonic-gate$(ROOTINC)/% : %
970Sstevel@tonic-gate	$(INS.file)
980Sstevel@tonic-gate
990Sstevel@tonic-gate.KEEP_STATE:
1000Sstevel@tonic-gate
1010Sstevel@tonic-gate.PARALLEL: $(MAILOBJS) $(OBJS)
1020Sstevel@tonic-gate
1030Sstevel@tonic-gateall:		$(PROG)
1040Sstevel@tonic-gate
1050Sstevel@tonic-gatemail: 		$(MAILOBJS)
1060Sstevel@tonic-gate	$(LINK.c) -o $@ $(MAILOBJS) $(LDLIBS)
1070Sstevel@tonic-gate	$(POST_PROCESS)
1080Sstevel@tonic-gate
1090Sstevel@tonic-gateinstall: all .WAIT $(ROOTBINPROG) $(ROOTSYMLINKS)
1100Sstevel@tonic-gate
1110Sstevel@tonic-gate# ROOTSYMLINKS
1120Sstevel@tonic-gate#
1130Sstevel@tonic-gate$(ROOTBIN)/rmail:
1140Sstevel@tonic-gate	$(RM) $@; $(SYMLINK) mail $@
1150Sstevel@tonic-gate
1160Sstevel@tonic-gatelint:
1170Sstevel@tonic-gate	$(LINT.c) $(MAILSRC)
1180Sstevel@tonic-gate
1190Sstevel@tonic-gateclean:
1200Sstevel@tonic-gate	$(RM) $(OBJS) $(MAILOBJS)
1210Sstevel@tonic-gate
1220Sstevel@tonic-gateclobber:
1230Sstevel@tonic-gate	$(RM) $(OBJS) $(MAILOBJS) mail
124