xref: /illumos-gate/usr/src/cmd/mailwrapper/Makefile (revision 5661bb7641e85c46713da7a3002b29ecd2c3daf0)
1287247a8SAlexander Pyhalov#
2287247a8SAlexander Pyhalov# This file and its contents are supplied under the terms of the
3287247a8SAlexander Pyhalov# Common Development and Distribution License ("CDDL"), version 1.0.
4287247a8SAlexander Pyhalov# You may only use this file in accordance with the terms of version
5287247a8SAlexander Pyhalov# 1.0 of the CDDL.
6287247a8SAlexander Pyhalov#
7287247a8SAlexander Pyhalov# A full copy of the text of the CDDL should have accompanied this
8287247a8SAlexander Pyhalov# source.  A copy of the CDDL is also available via the Internet at
9287247a8SAlexander Pyhalov# http://www.illumos.org/license/CDDL.
10287247a8SAlexander Pyhalov#
11287247a8SAlexander Pyhalov
12287247a8SAlexander Pyhalov#
13287247a8SAlexander Pyhalov# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
14287247a8SAlexander Pyhalov# Copyright 2014 Alexander Pyhalov
15*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
16287247a8SAlexander Pyhalov#
17287247a8SAlexander Pyhalov
18287247a8SAlexander Pyhalov
19287247a8SAlexander PyhalovLIBPROG=	mailwrapper
20287247a8SAlexander Pyhalov
21287247a8SAlexander PyhalovPROG= 	       $(LIBPROG)
22287247a8SAlexander Pyhalov
23287247a8SAlexander Pyhalovinclude ../Makefile.cmd
24287247a8SAlexander Pyhalov
25287247a8SAlexander PyhalovMWOBJS=		fgetln.o fparseln.o mailwrapper.o
26287247a8SAlexander Pyhalov
27287247a8SAlexander PyhalovCLOBBERFILES=	$(PROG)
28287247a8SAlexander PyhalovCLEANFILES=	$(MWOBJS)
29287247a8SAlexander Pyhalov
30287247a8SAlexander PyhalovSRCS=	 	$(MWOBJS:%.o=%.c)
31287247a8SAlexander Pyhalov
32287247a8SAlexander PyhalovCPROG=		mailwrapper
33287247a8SAlexander PyhalovCPROGSRC= 	$(CPROG:%=_%.c)
34287247a8SAlexander Pyhalov
35287247a8SAlexander PyhalovCFS=		mailer.conf
36287247a8SAlexander Pyhalov
37287247a8SAlexander PyhalovROOTETCFILES=$(CFS:%=$(ROOTETC)/%)
38287247a8SAlexander Pyhalov
39287247a8SAlexander Pyhalov$(ROOTETCFILES) :=	FILEMODE = 0644
40287247a8SAlexander Pyhalov
41287247a8SAlexander Pyhalov# installed modules
42287247a8SAlexander PyhalovROOTLIBPROG=	$(LIBPROG:%=$(ROOTLIB)/%)
43287247a8SAlexander Pyhalov
44287247a8SAlexander PyhalovROOTSYMLINKS=	$(ROOTBIN)/mailq \
45287247a8SAlexander Pyhalov		$(ROOTLIB)/sendmail \
46287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/newaliases \
47287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/sendmail
48287247a8SAlexander Pyhalov
49287247a8SAlexander PyhalovCPPFLAGS =	-I. $(CPPFLAGS.master)
50287247a8SAlexander Pyhalov
51287247a8SAlexander PyhalovLINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
52287247a8SAlexander Pyhalov
53*5661bb76SJohn LevonSMOFF += all_func_returns
54*5661bb76SJohn Levon
55287247a8SAlexander Pyhalov# conditional assignments
56287247a8SAlexander Pyhalov#
57287247a8SAlexander Pyhalovall:=		TARGET= all
58287247a8SAlexander Pyhalovinstall:=	TARGET= install
59287247a8SAlexander Pyhalovclean:=		TARGET= clean
60287247a8SAlexander Pyhalovclobber:=	TARGET= clobber
61287247a8SAlexander Pyhalovlint:=		TARGET= lint
62287247a8SAlexander Pyhalov
63287247a8SAlexander Pyhalov# install rules
64287247a8SAlexander Pyhalov$(ROOTINC)/% : %
65287247a8SAlexander Pyhalov	$(INS.file)
66287247a8SAlexander Pyhalov
67287247a8SAlexander Pyhalov.KEEP_STATE:
68287247a8SAlexander Pyhalov
69287247a8SAlexander Pyhalov.PARALLEL: $(MWOBJS) $(OBJS)
70287247a8SAlexander Pyhalov
71287247a8SAlexander Pyhalovall:		$(PROG)
72287247a8SAlexander Pyhalov
73287247a8SAlexander Pyhalovmailwrapper:	$(MWOBJS)
74287247a8SAlexander Pyhalov	$(LINK.c) -o $@ $(MWOBJS) $(LDLIBS)
75287247a8SAlexander Pyhalov	$(POST_PROCESS)
76287247a8SAlexander Pyhalov
77287247a8SAlexander Pyhalovinstall: all .WAIT $(ROOTLIBPROG) $(ROOTSYMLINKS) $(ROOTETCFILES)
78287247a8SAlexander Pyhalov
79287247a8SAlexander Pyhalov# ROOTSYMLINKS
80287247a8SAlexander Pyhalov#
81287247a8SAlexander Pyhalov$(ROOTBIN)/mailq:
82287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
83287247a8SAlexander Pyhalov
84287247a8SAlexander Pyhalov$(ROOTLIB)/sendmail:
85287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) mailwrapper $@
86287247a8SAlexander Pyhalov
87287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/newaliases:
88287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
89287247a8SAlexander Pyhalov
90287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/sendmail:
91287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
92287247a8SAlexander Pyhalov
93287247a8SAlexander Pyhalov$(ROOTETCMAIL)/%:  %
94287247a8SAlexander Pyhalov	$(INS.file)
95287247a8SAlexander Pyhalov
96287247a8SAlexander Pyhalovlint:
97287247a8SAlexander Pyhalov	$(LINT.c) $(SRCS)
98287247a8SAlexander Pyhalov
99287247a8SAlexander Pyhalovclean:
100287247a8SAlexander Pyhalov	$(RM) $(OBJS) $(MWOBJS) mailwrapper
101287247a8SAlexander Pyhalov
102287247a8SAlexander Pyhalovclobber: clean
103287247a8SAlexander Pyhalov	$(RM) $(ROOTSYMLINKS) $(ROOTLIBPROG) $(ROOTETCFILES)
104