xref: /titanic_50/usr/src/cmd/mailx/Makefile (revision 726fad2a65f16c200a03969c29cb5c86c2d427db)
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)
65LINTFLAGS= 	-hb
66LDLIBS +=	-lmail
67LDFLAGS +=	$(MAPFILE.NGB:%=-M%)
68
69# install rules
70$(ROOTMAILXD)/% : %
71	$(INS.file)
72
73$(ROOTETCMAILD)/% : $(MISC)/%
74	$(INS.file)
75
76.KEEP_STATE:
77
78all: $(PROG) $(MAILXHELP) $(MAILXRC) $(UCBMAILRC)
79
80$(PROG): $(OBJS) $(LIBMAIL)
81	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
82	$(POST_PROCESS)
83
84install: all $(ROOTMAILXD) $(ROOTPROG) $(ROOTMAILXHELP) \
85	$(ROOTMAILXRC) $(ROOTUCBMAIL) $(ROOTUCBCAPMAIL) $(ROOTUCBMAILRC)
86
87$(ROOTUCBMAIL) $(ROOTUCBCAPMAIL):
88	$(RM) $@; $(SYMLINK) ../bin/mailx $@
89
90$(ROOTMAILXD):
91	$(INS.dir)
92
93$(MAILXHELP): $(MISC)/$$@
94	$(GREP) -v '^#.*@(' $(MISC)/$@ > $@
95
96$(POFILE):      $(POFILES)
97	$(RM)	$@
98	cat     $(POFILES)      > $@
99
100clean:
101	$(RM) $(OBJS)
102
103lint: lint_SRCS
104
105include ../Makefile.targ
106
107FRC:
108