xref: /illumos-gate/usr/src/cmd/mailx/Makefile (revision 1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f)
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
73CLOBBERFILES += $(MAILXHELP)
74
75# install rules
76$(ROOTMAILXD)/% : %
77	$(INS.file)
78
79$(ROOTETCMAILD)/% : $(MISC)/%
80	$(INS.file)
81
82.KEEP_STATE:
83
84all: $(PROG) $(MAILXHELP) $(MAILXRC) $(UCBMAILRC)
85
86$(PROG): $(OBJS) $(LIBMAIL)
87	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
88	$(POST_PROCESS)
89
90install: all $(ROOTMAILXD) $(ROOTPROG) $(ROOTMAILXHELP) \
91	$(ROOTMAILXRC) $(ROOTUCBMAIL) $(ROOTUCBCAPMAIL) $(ROOTUCBMAILRC)
92
93$(ROOTUCBMAIL) $(ROOTUCBCAPMAIL):
94	$(RM) $@; $(SYMLINK) ../bin/mailx $@
95
96$(ROOTMAILXD):
97	$(INS.dir)
98
99$(MAILXHELP): $(MISC)/$$@
100	$(GREP) -v '^#.*@(' $(MISC)/$@ > $@
101
102$(POFILE):      $(POFILES)
103	$(RM)	$@
104	cat     $(POFILES)      > $@
105
106clean:
107	$(RM) $(OBJS)
108
109lint: lint_SRCS
110
111include ../Makefile.targ
112
113FRC:
114