5166 sendmail package should be replaceable
[illumos-gate.git] / usr / src / cmd / mailwrapper / Makefile
blob0e66a47b93b40b661846b763bba9de46c021d1a7
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
14 # Copyright 2014 Alexander Pyhalov
18 LIBPROG= mailwrapper
20 PROG= $(LIBPROG)
22 include ../Makefile.cmd
24 MWOBJS= fgetln.o fparseln.o mailwrapper.o
26 CLOBBERFILES= $(PROG)
27 CLEANFILES= $(MWOBJS)
29 SRCS= $(MWOBJS:%.o=%.c)
31 CPROG= mailwrapper
32 CPROGSRC= $(CPROG:%=_%.c)
34 CFS= mailer.conf
36 ROOTETCFILES=$(CFS:%=$(ROOTETC)/%)
38 $(ROOTETCFILES) := FILEMODE = 0644
40 # installed modules
41 ROOTLIBPROG= $(LIBPROG:%=$(ROOTLIB)/%)
43 ROOTSYMLINKS= $(ROOTBIN)/mailq \
44 $(ROOTLIB)/sendmail \
45 $(ROOTUSRSBIN)/newaliases \
46 $(ROOTUSRSBIN)/sendmail
48 CPPFLAGS = -I. $(CPPFLAGS.master)
50 LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
52 # conditional assignments
54 all:= TARGET= all
55 install:= TARGET= install
56 clean:= TARGET= clean
57 clobber:= TARGET= clobber
58 lint:= TARGET= lint
60 # install rules
61 $(ROOTINC)/% : %
62 $(INS.file)
64 .KEEP_STATE:
66 .PARALLEL: $(MWOBJS) $(OBJS)
68 all: $(PROG)
70 mailwrapper: $(MWOBJS)
71 $(LINK.c) -o $@ $(MWOBJS) $(LDLIBS)
72 $(POST_PROCESS)
74 install: all .WAIT $(ROOTLIBPROG) $(ROOTSYMLINKS) $(ROOTETCFILES)
76 # ROOTSYMLINKS
78 $(ROOTBIN)/mailq:
79 $(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
81 $(ROOTLIB)/sendmail:
82 $(RM) $@; $(SYMLINK) mailwrapper $@
84 $(ROOTUSRSBIN)/newaliases:
85 $(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
87 $(ROOTUSRSBIN)/sendmail:
88 $(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
90 $(ROOTETCMAIL)/%: %
91 $(INS.file)
93 lint:
94 $(LINT.c) $(SRCS)
96 clean:
97 $(RM) $(OBJS) $(MWOBJS) mailwrapper
99 clobber: clean
100 $(RM) $(ROOTSYMLINKS) $(ROOTLIBPROG) $(ROOTETCFILES)