xref: /titanic_41/usr/src/cmd/mailx/Makefile (revision f5c2e7ea56aaa46a9976476fb0cb1f02b9426f07)
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# cmd/mailx/Makefile
26
27PROG= mailx
28
29OBJS=	myfopen.o aux.o cmd1.o cmd2.o cmd3.o \
30	cmd4.o cmdtab.o collect.o config.o edit.o \
31	init.o fio.o getname.o head.o \
32	hostname.o lex.o list.o lock.o lpaths.o \
33	main.o names.o optim.o popen.o quit.o \
34	receipt.o send.o sigretro.o stralloc.o temp.o \
35	translate.o tty.o usg.local.o vars.o
36
37SRCS=	$(OBJS:.o=.c)
38
39MISC= misc
40
41include ../Makefile.cmd
42#
43# for messaging catalogue file
44#
45POFILE= mailx.po
46POFILES= $(SRCS:%.c=%.po)
47
48ROOTMAILXD=	$(ROOTSHLIB)/mailx
49ROOTETCMAILD=	$(ROOTETC)/mail
50MAILXHELP=	mailx.help mailx.help.~
51ROOTMAILXHELP=	$(MAILXHELP:%=$(ROOTMAILXD)/%)
52MAILXRC=	$(MISC)/mailx.rc
53UCBMAILRC=	$(MISC)/Mail.rc
54ROOTMAILXRC=	$(MAILXRC:$(MISC)/%=$(ROOTETCMAILD)/%)
55ROOTUCBMAILRC=	$(UCBMAILRC:$(MISC)/%=$(ROOTETCMAILD)/%)
56ROOTUCBMAIL=	$(ROOT)/usr/ucb/mail
57ROOTUCBCAPMAIL=	$(ROOT)/usr/ucb/Mail
58
59$(ROOTPROG) :=		FILEMODE =	02511
60$(ROOTMAILXHELP) :=	FILEMODE =	0644
61$(ROOTMAILXRC) :=	FILEMODE =	0644
62$(ROOTUCBMAILRC) :=	FILEMODE =	0644
63
64CPPFLAGS=	-Ihdr -DUSG -DOPTIM $(CPPFLAGS.master)
65CERRWARN +=	-_gcc=-Wno-parentheses
66CERRWARN +=	-_gcc=-Wno-uninitialized
67CERRWARN +=	-_gcc=-Wno-unused-variable
68CERRWARN +=	-_gcc=-Wno-clobbered
69LINTFLAGS= 	-hb
70LDLIBS +=	-lmail
71LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
72
73# install rules
74$(ROOTMAILXD)/% : %
75	$(INS.file)
76
77$(ROOTETCMAILD)/% : $(MISC)/%
78	$(INS.file)
79
80.KEEP_STATE:
81
82all: $(PROG) $(MAILXHELP) $(MAILXRC) $(UCBMAILRC)
83
84$(PROG): $(OBJS) $(LIBMAIL)
85	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
86	$(POST_PROCESS)
87
88install: all $(ROOTMAILXD) $(ROOTPROG) $(ROOTMAILXHELP) \
89	$(ROOTMAILXRC) $(ROOTUCBMAIL) $(ROOTUCBCAPMAIL) $(ROOTUCBMAILRC)
90
91$(ROOTUCBMAIL) $(ROOTUCBCAPMAIL):
92	$(RM) $@; $(SYMLINK) ../bin/mailx $@
93
94$(ROOTMAILXD):
95	$(INS.dir)
96
97$(MAILXHELP): $(MISC)/$$@
98	$(GREP) -v '^#.*@(' $(MISC)/$@ > $@
99
100$(POFILE):      $(POFILES)
101	$(RM)	$@
102	cat     $(POFILES)      > $@
103
104clean:
105	$(RM) $(OBJS)
106
107lint: lint_SRCS
108
109include ../Makefile.targ
110
111FRC:
112