File: Makefile.in

package info (click to toggle)
milter-greylist 4.5.11-1.1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,828 kB
  • ctags: 1,830
  • sloc: ansic: 17,049; yacc: 2,158; lex: 585; sh: 536; makefile: 156
file content (194 lines) | stat: -rw-r--r-- 6,967 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# $Id: Makefile.in,v 1.75 2013/09/02 03:54:35 manu Exp $

#
# Copyright (c) 2004 Emmanuel Dreyfus
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#        This product includes software developed by Emmanuel Dreyfus
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
#

CFLAGS= 	@CFLAGS@ -D_DEFAULT_SOURCE -I. -I${SRCDIR} @CPPFLAGS@
LDFLAGS=	@LDFLAGS@
LIBS= 		@LIBS@
prefix=		@prefix@
datarootdir=	@datarootdir@
exec_prefix=	@exec_prefix@
SYSCONFDIR=	@sysconfdir@
LOCALSTATEDIR=	@localstatedir@
SRCDIR=		@srcdir@
BINDIR=		@bindir@
SBINDIR=        @sbindir@
MANDIR=		@mandir@
USER=		@USER@
CONFFILE=       @CONFFILE@
DUMPFILE=       @DUMPFILE@

# If your make complains about -j, try --disable-parallel-make
MAKESEQ=        $(MAKE) @MAKE_J1@

CC=		@CC@
MKDEP=		@MKDEP@
RM=		@RM@
MV=		@MV@
TEST=		@TEST@
SED=		@SED@
INSTALL=	@INSTALL@
LEX=		@LEX@
YACC=		@YACC@
TRUE=		@TRUE@
TOUCH=		@TOUCH@

OBJ= 		milter-greylist.o pending.o sync.o dnsrbl.o list.o macro.o \
		conf.o store.o dump.o spf.o acl.o urlcheck.o stat.o clock.o \
		geoip.o fd_pool.o prop.o ldapcheck.o dkimcheck.o p0f.o \
		spamd.o mx.o ratelimit.o nsupdate.o brokenmfapi.o
OBJ_SEQ=	conf_yacc.o dump_yacc.o
OBJ_SEQ_FLAG=	.objseq-built
SRC= 		milter-greylist.c pending.c sync.c conf.c macro.c stat.c \
		clock.c store.c dump.c spf.c acl.c dnsrbl.c list.c \
		urlcheck.c geoip.c prop.c ldapcheck.c dkimcheck.c p0f.c \
		spamd.c mx.c ratelimit.c nsupdate.c brokenmfapi.c
GENSRC=		conf_yacc.c conf_lex.c dump_yacc.c dump_lex.c

VPATH=		${SRCDIR}

all:		milter-greylist rc-bsd.sh rc-redhat.sh \
		rc-solaris.sh rc-debian.sh rc-gentoo.sh rc-suse.sh

# GNU make: targets which are not expected to produce same-named files
.PHONY:		bld-milter-greylist obj-seq bld-seq all-seq

milter-greylist:	${OBJ} ${OBJ_SEQ_FLAG}
	@echo "=== Linking $@:"
	${CC} -o $@ ${OBJ} ${OBJ_SEQ} ${LDFLAGS} ${LIBS}

# The idea is that a successful obj-seq build would produce the flag-file,
# thus "milter-greylist"'s verifiable dependencies are satisfied and the
# binary is not relinked on every make run. However, code updates that can
# cause rebuilds of ${OBJ_SEQ} files might require a "gmake rebuild" now.
${OBJ_SEQ_FLAG}:	obj-seq
	sync || $(TRUE)

all-seq:	obj-seq
obj-seq:
	@echo "=== Call make sequential for objects sensitive to that (current make='$(MAKE)' MAKEFLAGS='$(MAKEFLAGS)'):"
	$(MAKESEQ) bld-seq

bld-seq:	${OBJ_SEQ}
	$(TEST) -f ${OBJ_SEQ_FLAG} || $(TOUCH) ${OBJ_SEQ_FLAG}

sync_yacc.o:	sync_yacc.c sync_lex.c
conf_yacc.o:	conf_yacc.c conf_lex.c
dump_yacc.o:	dump_yacc.c dump_lex.c

sed_subst = "s|@BINDIR[@]|${BINDIR}|g; s|@SBINDIR[@]|${SBINDIR}|g; s|@USER[@]|${USER}|g"

rc-bsd.sh:      rc-bsd.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@
rc-redhat.sh:    rc-redhat.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@
rc-solaris.sh:    rc-solaris.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@
rc-debian.sh:    rc-debian.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@
rc-gentoo.sh:    rc-gentoo.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@
rc-suse.sh:	 rc-suse.sh.in
	${SED} ${sed_subst} ${SRCDIR}/$< > $@

install-daemon-to-bin: milter-greylist
	${INSTALL} -d -m 755 ${DESTDIR}${BINDIR}
	${INSTALL} -m 755 milter-greylist ${DESTDIR}${BINDIR}

install-sbin: milter-greylist
	${INSTALL} -d -m 755 ${DESTDIR}${SBINDIR}
	${INSTALL} -m 755 milter-greylist ${DESTDIR}${SBINDIR}

install-man:
	${INSTALL} -d -m 755 ${DESTDIR}${MANDIR}/man8
	${INSTALL} -d -m 755 ${DESTDIR}${MANDIR}/man5
	${INSTALL} -m 644 ${SRCDIR}/milter-greylist.8 ${DESTDIR}${MANDIR}/man8
	${INSTALL} -m 644 ${SRCDIR}/greylist.conf.5 ${DESTDIR}${MANDIR}/man5

install-conf:
	${INSTALL} -d -m 755 ${DESTDIR}`dirname ${CONFFILE}`
	${TEST} -f ${DESTDIR}${CONFFILE} -o 	\
		-f ${DESTDIR}/etc/mail/greylist.except || 	\
	     ${INSTALL} -m 644 ${SRCDIR}/greylist.conf ${DESTDIR}${CONFFILE}
	@${TEST} -f ${DESTDIR}/etc/mail/greylist.except && (	 	   \
		echo "	================================================"; \
		echo "	 WARNING: the config file name has changed,     "; \
		echo "	 Please rename /etc/mail/greylist.except, the   "; \
		echo "	 default name is now in ${CONFFILE}             "; \
		echo "	================================================"; \
	) || ${TRUE}

install-db:
	${INSTALL} -d -m 755 -o ${USER} ${DESTDIR}`dirname ${DUMPFILE}`
	@${TEST} -f ${DESTDIR}/var/db/greylist.db && (			 	   \
		echo "	================================================"; \
		echo "	  WARNING: the dump file location has changed,  "; \
		echo "	  Please move /var/db/greylist.db, the default  "; \
		echo "	  location is now in ${DUMPFILE}                "; \
		echo "	================================================"; \
	) || ${TRUE}

install: install-daemon-to-bin install-man install-conf install-db

depend:
	${MKDEP} ${CPPFLAGS} ${CFLAGS} ${SRC}

clean:
	${RM} -f milter-greylist ${OBJ} ${OBJ_SEQ} ${OBJ_SEQ_FLAG} ${GENSRC} \
		rc-redhat.sh rc-bsd.sh rc-solaris.sh rc-debian.sh rc-gentoo.sh \
		rc-suse.sh y.tab.c
	sync || $(TRUE)

realclean:	clean
	${RM} -Rf Makefile config.h config.log config.status \
		 autom4te.cache configure.lineno *.orig *.bak autoscan.log
	sync || $(TRUE)

distclean:	realclean

rebuild:	clean
	@echo "=== Making all. MAKEFLAGS=$(MAKEFLAGS)"
	@$(MAKE) all || ( \
		echo "==============================================================="; \
		echo "=== First build failed. Making all sequentially just in case..."; \
		echo "==============================================================="; \
		sync || $(TRUE); \
		$(MAKESEQ) all )

.SUFFIXES:	.o .c .h .y .l
.l.c:
	${LEX} -o$@ $<
.y.c:
	${YACC} -p`echo $@|${SED} 's/^\([^_]\{1,\}_\).*$$/\1/'` $<
	${MV} y.tab.c $@

# This is a target for debugging
start:	milter-greylist
	./milter-greylist -D -v -p milter-greylist.sock