xref: /illumos-gate/usr/src/cmd/mailx/Makefile (revision 85f4cb87104c72587029a6e0f1663332c85ba118)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
596ccc8cbSesaxe# Common Development and Distribution License (the "License").
696ccc8cbSesaxe# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
2224fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
25500cf85bSJason King# Copyright 2018 Joyent, Inc.
26955eb5e1SGarrett D'Amore# Copyright 2019 Garrett D'Amore <garrett@damore.org>
27196c7f05SJoshua M. Clulow#
287c478bd9Sstevel@tonic-gate# cmd/mailx/Makefile
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gatePROG= mailx
317c478bd9Sstevel@tonic-gate
32955eb5e1SGarrett D'AmoreOBJS=	myfopen.o cmd1.o cmd2.o cmd3.o \
337c478bd9Sstevel@tonic-gate	cmd4.o cmdtab.o collect.o config.o edit.o \
347c478bd9Sstevel@tonic-gate	init.o fio.o getname.o head.o \
357c478bd9Sstevel@tonic-gate	hostname.o lex.o list.o lock.o lpaths.o \
367c478bd9Sstevel@tonic-gate	main.o names.o optim.o popen.o quit.o \
377c478bd9Sstevel@tonic-gate	receipt.o send.o sigretro.o stralloc.o temp.o \
38955eb5e1SGarrett D'Amore	translate.o tty.o usg.local.o util.o vars.o
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateSRCS=	$(OBJS:.o=.c)
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateMISC= misc
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
457c478bd9Sstevel@tonic-gate#
467c478bd9Sstevel@tonic-gate# for messaging catalogue file
477c478bd9Sstevel@tonic-gate#
487c478bd9Sstevel@tonic-gatePOFILE= mailx.po
497c478bd9Sstevel@tonic-gatePOFILES= $(SRCS:%.c=%.po)
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gateROOTMAILXD=	$(ROOTSHLIB)/mailx
527c478bd9Sstevel@tonic-gateROOTETCMAILD=	$(ROOTETC)/mail
537c478bd9Sstevel@tonic-gateMAILXHELP=	mailx.help mailx.help.~
547c478bd9Sstevel@tonic-gateROOTMAILXHELP=	$(MAILXHELP:%=$(ROOTMAILXD)/%)
557c478bd9Sstevel@tonic-gateMAILXRC=	$(MISC)/mailx.rc
567c478bd9Sstevel@tonic-gateUCBMAILRC=	$(MISC)/Mail.rc
577c478bd9Sstevel@tonic-gateROOTMAILXRC=	$(MAILXRC:$(MISC)/%=$(ROOTETCMAILD)/%)
587c478bd9Sstevel@tonic-gateROOTUCBMAILRC=	$(UCBMAILRC:$(MISC)/%=$(ROOTETCMAILD)/%)
597c478bd9Sstevel@tonic-gateROOTUCBMAIL=	$(ROOT)/usr/ucb/mail
607c478bd9Sstevel@tonic-gateROOTUCBCAPMAIL=	$(ROOT)/usr/ucb/Mail
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gate$(ROOTPROG) :=		FILEMODE =	02511
637c478bd9Sstevel@tonic-gate$(ROOTMAILXHELP) :=	FILEMODE =	0644
647c478bd9Sstevel@tonic-gate$(ROOTMAILXRC) :=	FILEMODE =	0644
657c478bd9Sstevel@tonic-gate$(ROOTUCBMAILRC) :=	FILEMODE =	0644
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gateCPPFLAGS=	-Ihdr -DUSG -DOPTIM $(CPPFLAGS.master)
687014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-parentheses
69d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
707014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
717014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-clobbered
725661bb76SJohn Levon# not linted
735661bb76SJohn LevonSMATCH=off
745661bb76SJohn Levon
75500cf85bSJason KingLDLIBS +=	-lmail -lcustr
76*85f4cb87SRichard LoweLDFLAGS +=	$(MAPFILE.NGB:%=-Wl,-M%)
777c478bd9Sstevel@tonic-gate
78b6805bf7SGordon RossCLOBBERFILES += $(MAILXHELP)
79b6805bf7SGordon Ross
807c478bd9Sstevel@tonic-gate# install rules
817c478bd9Sstevel@tonic-gate$(ROOTMAILXD)/% : %
827c478bd9Sstevel@tonic-gate	$(INS.file)
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate$(ROOTETCMAILD)/% : $(MISC)/%
857c478bd9Sstevel@tonic-gate	$(INS.file)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate.KEEP_STATE:
887c478bd9Sstevel@tonic-gate
897c478bd9Sstevel@tonic-gateall: $(PROG) $(MAILXHELP) $(MAILXRC) $(UCBMAILRC)
907c478bd9Sstevel@tonic-gate
9196ccc8cbSesaxe$(PROG): $(OBJS) $(LIBMAIL)
9296ccc8cbSesaxe	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
937c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gateinstall: all $(ROOTMAILXD) $(ROOTPROG) $(ROOTMAILXHELP) \
967c478bd9Sstevel@tonic-gate	$(ROOTMAILXRC) $(ROOTUCBMAIL) $(ROOTUCBCAPMAIL) $(ROOTUCBMAILRC)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gate$(ROOTUCBMAIL) $(ROOTUCBCAPMAIL):
997c478bd9Sstevel@tonic-gate	$(RM) $@; $(SYMLINK) ../bin/mailx $@
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate$(ROOTMAILXD):
1027c478bd9Sstevel@tonic-gate	$(INS.dir)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate$(MAILXHELP): $(MISC)/$$@
1057c478bd9Sstevel@tonic-gate	$(GREP) -v '^#.*@(' $(MISC)/$@ > $@
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
1087c478bd9Sstevel@tonic-gate	$(RM)	$@
1097c478bd9Sstevel@tonic-gate	cat     $(POFILES)      > $@
1107c478bd9Sstevel@tonic-gate
1117c478bd9Sstevel@tonic-gateclean:
11296ccc8cbSesaxe	$(RM) $(OBJS)
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gateFRC:
117