xref: /illumos-gate/usr/src/cmd/mailwrapper/Makefile (revision d17be682a2c70b4505d43c830bbd2603da11918d)
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 PyhalovCPROG=		mailwrapper
31287247a8SAlexander PyhalovCPROGSRC=	$(CPROG:%=_%.c)
32287247a8SAlexander Pyhalov
33287247a8SAlexander PyhalovCFS=		mailer.conf
34287247a8SAlexander Pyhalov
35287247a8SAlexander PyhalovROOTETCFILES=$(CFS:%=$(ROOTETC)/%)
36287247a8SAlexander Pyhalov
37287247a8SAlexander Pyhalov$(ROOTETCFILES) :=	FILEMODE = 0644
38287247a8SAlexander Pyhalov
39287247a8SAlexander Pyhalov# installed modules
40287247a8SAlexander PyhalovROOTLIBPROG=	$(LIBPROG:%=$(ROOTLIB)/%)
41287247a8SAlexander Pyhalov
42287247a8SAlexander PyhalovROOTSYMLINKS=	$(ROOTBIN)/mailq \
43287247a8SAlexander Pyhalov		$(ROOTLIB)/sendmail \
44287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/newaliases \
45287247a8SAlexander Pyhalov		$(ROOTUSRSBIN)/sendmail
46287247a8SAlexander Pyhalov
47287247a8SAlexander PyhalovCPPFLAGS =	-I. $(CPPFLAGS.master)
48287247a8SAlexander Pyhalov
49*5661bb76SJohn LevonSMOFF += all_func_returns
50*5661bb76SJohn Levon
51287247a8SAlexander Pyhalov# conditional assignments
52287247a8SAlexander Pyhalov#
53287247a8SAlexander Pyhalovall:=		TARGET= all
54287247a8SAlexander Pyhalovinstall:=	TARGET= install
55287247a8SAlexander Pyhalovclean:=		TARGET= clean
56287247a8SAlexander Pyhalovclobber:=	TARGET= clobber
57287247a8SAlexander Pyhalov
58287247a8SAlexander Pyhalov# install rules
59287247a8SAlexander Pyhalov$(ROOTINC)/% : %
60287247a8SAlexander Pyhalov	$(INS.file)
61287247a8SAlexander Pyhalov
62287247a8SAlexander Pyhalov.KEEP_STATE:
63287247a8SAlexander Pyhalov
64287247a8SAlexander Pyhalov.PARALLEL: $(MWOBJS) $(OBJS)
65287247a8SAlexander Pyhalov
66287247a8SAlexander Pyhalovall:		$(PROG)
67287247a8SAlexander Pyhalov
68287247a8SAlexander Pyhalovmailwrapper:	$(MWOBJS)
69287247a8SAlexander Pyhalov	$(LINK.c) -o $@ $(MWOBJS) $(LDLIBS)
70287247a8SAlexander Pyhalov	$(POST_PROCESS)
71287247a8SAlexander Pyhalov
72287247a8SAlexander Pyhalovinstall: all .WAIT $(ROOTLIBPROG) $(ROOTSYMLINKS) $(ROOTETCFILES)
73287247a8SAlexander Pyhalov
74287247a8SAlexander Pyhalov# ROOTSYMLINKS
75287247a8SAlexander Pyhalov#
76287247a8SAlexander Pyhalov$(ROOTBIN)/mailq:
77287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
78287247a8SAlexander Pyhalov
79287247a8SAlexander Pyhalov$(ROOTLIB)/sendmail:
80287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) mailwrapper $@
81287247a8SAlexander Pyhalov
82287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/newaliases:
83287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
84287247a8SAlexander Pyhalov
85287247a8SAlexander Pyhalov$(ROOTUSRSBIN)/sendmail:
86287247a8SAlexander Pyhalov	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
87287247a8SAlexander Pyhalov
88287247a8SAlexander Pyhalov$(ROOTETCMAIL)/%:  %
89287247a8SAlexander Pyhalov	$(INS.file)
90287247a8SAlexander Pyhalov
91287247a8SAlexander Pyhalovclean:
92287247a8SAlexander Pyhalov	$(RM) $(OBJS) $(MWOBJS) mailwrapper
93287247a8SAlexander Pyhalov
94287247a8SAlexander Pyhalovclobber: clean
95287247a8SAlexander Pyhalov	$(RM) $(ROOTSYMLINKS) $(ROOTLIBPROG) $(ROOTETCFILES)
96