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