xref: /titanic_50/usr/src/cmd/mailwrapper/Makefile (revision 287247a826fa2ab8d01f6c8f276d405eb08420f8)
1*287247a8SAlexander Pyhalov#
2*287247a8SAlexander Pyhalov# This file and its contents are supplied under the terms of the
3*287247a8SAlexander Pyhalov# Common Development and Distribution License ("CDDL"), version 1.0.
4*287247a8SAlexander Pyhalov# You may only use this file in accordance with the terms of version
5*287247a8SAlexander Pyhalov# 1.0 of the CDDL.
6*287247a8SAlexander Pyhalov#
7*287247a8SAlexander Pyhalov# A full copy of the text of the CDDL should have accompanied this
8*287247a8SAlexander Pyhalov# source.  A copy of the CDDL is also available via the Internet at
9*287247a8SAlexander Pyhalov# http://www.illumos.org/license/CDDL.
10*287247a8SAlexander Pyhalov#
11*287247a8SAlexander Pyhalov
12*287247a8SAlexander Pyhalov#
13*287247a8SAlexander Pyhalov# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
14*287247a8SAlexander Pyhalov# Copyright 2014 Alexander Pyhalov
15*287247a8SAlexander Pyhalov#
16*287247a8SAlexander Pyhalov
17*287247a8SAlexander Pyhalov
18*287247a8SAlexander PyhalovLIBPROG=	mailwrapper
19*287247a8SAlexander Pyhalov
20*287247a8SAlexander PyhalovPROG= 	       $(LIBPROG)
21*287247a8SAlexander Pyhalov
22*287247a8SAlexander Pyhalovinclude ../Makefile.cmd
23*287247a8SAlexander Pyhalov
24*287247a8SAlexander PyhalovMWOBJS=		fgetln.o fparseln.o mailwrapper.o
25*287247a8SAlexander Pyhalov
26*287247a8SAlexander PyhalovCLOBBERFILES=	$(PROG)
27*287247a8SAlexander PyhalovCLEANFILES=	$(MWOBJS)
28*287247a8SAlexander Pyhalov
29*287247a8SAlexander PyhalovSRCS=	 	$(MWOBJS:%.o=%.c)
30*287247a8SAlexander Pyhalov
31*287247a8SAlexander PyhalovCPROG=		mailwrapper
32*287247a8SAlexander PyhalovCPROGSRC= 	$(CPROG:%=_%.c)
33*287247a8SAlexander Pyhalov
34*287247a8SAlexander PyhalovCFS=		mailer.conf
35*287247a8SAlexander Pyhalov
36*287247a8SAlexander PyhalovROOTETCFILES=$(CFS:%=$(ROOTETC)/%)
37*287247a8SAlexander Pyhalov
38*287247a8SAlexander Pyhalov$(ROOTETCFILES) :=	FILEMODE = 0644
39*287247a8SAlexander Pyhalov
40*287247a8SAlexander Pyhalov# installed modules
41*287247a8SAlexander PyhalovROOTLIBPROG=	$(LIBPROG:%=$(ROOTLIB)/%)
42*287247a8SAlexander Pyhalov
43*287247a8SAlexander PyhalovROOTSYMLINKS=	$(ROOTBIN)/mailq \
44*287247a8SAlexander Pyhalov		$(ROOTLIB)/sendmail \
45*287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/newaliases \
46*287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/sendmail
47*287247a8SAlexander Pyhalov
48*287247a8SAlexander PyhalovCPPFLAGS =	-I. $(CPPFLAGS.master)
49*287247a8SAlexander Pyhalov
50*287247a8SAlexander PyhalovLINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
51*287247a8SAlexander Pyhalov
52*287247a8SAlexander Pyhalov# conditional assignments
53*287247a8SAlexander Pyhalov#
54*287247a8SAlexander Pyhalovall:=		TARGET= all
55*287247a8SAlexander Pyhalovinstall:=	TARGET= install
56*287247a8SAlexander Pyhalovclean:=		TARGET= clean
57*287247a8SAlexander Pyhalovclobber:=	TARGET= clobber
58*287247a8SAlexander Pyhalovlint:=		TARGET= lint
59*287247a8SAlexander Pyhalov
60*287247a8SAlexander Pyhalov# install rules
61*287247a8SAlexander Pyhalov$(ROOTINC)/% : %
62*287247a8SAlexander Pyhalov	$(INS.file)
63*287247a8SAlexander Pyhalov
64*287247a8SAlexander Pyhalov.KEEP_STATE:
65*287247a8SAlexander Pyhalov
66*287247a8SAlexander Pyhalov.PARALLEL: $(MWOBJS) $(OBJS)
67*287247a8SAlexander Pyhalov
68*287247a8SAlexander Pyhalovall:		$(PROG)
69*287247a8SAlexander Pyhalov
70*287247a8SAlexander Pyhalovmailwrapper:	$(MWOBJS)
71*287247a8SAlexander Pyhalov	$(LINK.c) -o $@ $(MWOBJS) $(LDLIBS)
72*287247a8SAlexander Pyhalov	$(POST_PROCESS)
73*287247a8SAlexander Pyhalov
74*287247a8SAlexander Pyhalovinstall: all .WAIT $(ROOTLIBPROG) $(ROOTSYMLINKS) $(ROOTETCFILES)
75*287247a8SAlexander Pyhalov
76*287247a8SAlexander Pyhalov# ROOTSYMLINKS
77*287247a8SAlexander Pyhalov#
78*287247a8SAlexander Pyhalov$(ROOTBIN)/mailq:
79*287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
80*287247a8SAlexander Pyhalov
81*287247a8SAlexander Pyhalov$(ROOTLIB)/sendmail:
82*287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) mailwrapper $@
83*287247a8SAlexander Pyhalov
84*287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/newaliases:
85*287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
86*287247a8SAlexander Pyhalov
87*287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/sendmail:
88*287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
89*287247a8SAlexander Pyhalov
90*287247a8SAlexander Pyhalov$(ROOTETCMAIL)/%:  %
91*287247a8SAlexander Pyhalov	$(INS.file)
92*287247a8SAlexander Pyhalov
93*287247a8SAlexander Pyhalovlint:
94*287247a8SAlexander Pyhalov	$(LINT.c) $(SRCS)
95*287247a8SAlexander Pyhalov
96*287247a8SAlexander Pyhalovclean:
97*287247a8SAlexander Pyhalov	$(RM) $(OBJS) $(MWOBJS) mailwrapper
98*287247a8SAlexander Pyhalov
99*287247a8SAlexander Pyhalovclobber: clean
100*287247a8SAlexander Pyhalov	$(RM) $(ROOTSYMLINKS) $(ROOTLIBPROG) $(ROOTETCFILES)
101