xref: /titanic_44/usr/src/cmd/mailwrapper/Makefile (revision 87308b749adb04ab3f564c765b089962af3edb4d)
1#
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.
6#
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.
10#
11
12#
13# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
14# Copyright 2014 Alexander Pyhalov
15#
16
17
18LIBPROG=	mailwrapper
19
20PROG= 	       $(LIBPROG)
21
22include ../Makefile.cmd
23
24MWOBJS=		fgetln.o fparseln.o mailwrapper.o
25
26CLOBBERFILES=	$(PROG)
27CLEANFILES=	$(MWOBJS)
28
29SRCS=	 	$(MWOBJS:%.o=%.c)
30
31CPROG=		mailwrapper
32CPROGSRC= 	$(CPROG:%=_%.c)
33
34CFS=		mailer.conf
35
36ROOTETCFILES=$(CFS:%=$(ROOTETC)/%)
37
38$(ROOTETCFILES) :=	FILEMODE = 0644
39
40# installed modules
41ROOTLIBPROG=	$(LIBPROG:%=$(ROOTLIB)/%)
42
43ROOTSYMLINKS=	$(ROOTBIN)/mailq \
44		$(ROOTLIB)/sendmail \
45		$(ROOTUSRSBIN)/newaliases \
46		$(ROOTUSRSBIN)/sendmail
47
48CPPFLAGS =	-I. $(CPPFLAGS.master)
49
50LINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
51
52# conditional assignments
53#
54all:=		TARGET= all
55install:=	TARGET= install
56clean:=		TARGET= clean
57clobber:=	TARGET= clobber
58lint:=		TARGET= lint
59
60# install rules
61$(ROOTINC)/% : %
62	$(INS.file)
63
64.KEEP_STATE:
65
66.PARALLEL: $(MWOBJS) $(OBJS)
67
68all:		$(PROG)
69
70mailwrapper:	$(MWOBJS)
71	$(LINK.c) -o $@ $(MWOBJS) $(LDLIBS)
72	$(POST_PROCESS)
73
74install: all .WAIT $(ROOTLIBPROG) $(ROOTSYMLINKS) $(ROOTETCFILES)
75
76# ROOTSYMLINKS
77#
78$(ROOTBIN)/mailq:
79	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
80
81$(ROOTLIB)/sendmail:
82	$(RM) $@; $(SYMLINK) mailwrapper $@
83
84$(ROOTUSRSBIN)/newaliases:
85	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
86
87$(ROOTUSRSBIN)/sendmail:
88	$(RM) $@; $(SYMLINK) ../lib/mailwrapper $@
89
90$(ROOTETCMAIL)/%:  %
91	$(INS.file)
92
93lint:
94	$(LINT.c) $(SRCS)
95
96clean:
97	$(RM) $(OBJS) $(MWOBJS) mailwrapper
98
99clobber: clean
100	$(RM) $(ROOTSYMLINKS) $(ROOTLIBPROG) $(ROOTETCFILES)
101