forked from spamhaus/rbldnsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
232 lines (196 loc) · 6.81 KB
/
Makefile.in
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#! /usr/bin/make -rf
#
# Makefile for rbldnsd
SHELL = /bin/sh
CC = @CC@
CFLAGS = -Wno-implicit-fallthrough -Wno-unused-result @CFLAGS@
LD = @LD@
LDFLAGS = @LDFLAGS@
AR = @AR@
ARFLAGS = @ARFLAGS@
RANLIB = @RANLIB@
AWK = @AWK@
# Debian, since the deprecation of python2, suggests to keep the python2 binary as `python`
# As the tests are usually run on debian, we will force python3 instead of python
PYTHON = python3
GNUTAR = tar
PKG_CONFIG = @PKGCONFIG@
USE_SYSTEMD = @USE_SYSTEMD@
# Disable statistic counters
#DEFS = -DNO_STATS
# Disable printing zone (re)load time using utimes()
#DEFS = -DNO_TIMES
# Disable memory info logging (mallinfo)
#DEFS = -DNO_MEMINFO
# If you don't want/have IPv6 support (transport only)
#DEFS = -DNO_IPv6
# To turn on recognision of ipv6-mapped ipv4 queries (silly idea?)
#DEFS = -DRECOGNIZE_IP4IN6
# To use select() instead of poll()
#DEFS = -DNO_POLL
# To disable master-format (named) dump (-d option)
#DEFS = -DNO_MASTER_DUMP
# To disable usage of zlib (also LIBS - for zlib, -lz is needed)
#DEFS = -DNO_ZLIB
# To disable asserts
#DEFS = -DNDEBUG
#
DEFS =
LIBS = @LIBS@
ifeq ($(USE_SYSTEMD), 1)
CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd)
LIBS += $(shell $(PKG_CONFIG) --libs libsystemd)
endif
NAME = rbldnsd
# taken from NEWS, by ./configure
VERSION = @VERSION@
VERSION_DATE = @VERSION_DATE@
LIBDNS_SRCS = dns_ptodn.c dns_dntop.c dns_dntol.c dns_dnlen.c dns_dnlabels.c \
dns_dnequ.c dns_dnreverse.c dns_findname.c
LIBDNS_GSRC = dns_nametab.c
LIBDNS_HDRS = dns.h
LIBDNS_OBJS = $(LIBDNS_SRCS:.c=.o) $(LIBDNS_GSRC:.c=.o)
LIBIP_SRCS = ip4parse.c ip4atos.c ip4mask.c ip6addr.c
LIBIP_GSRC =
LIBIP_HDRS = ip4addr.h ip6addr.h
LIBIP_OBJS = $(LIBIP_SRCS:.c=.o)
LIB_SRCS = $(LIBDNS_SRCS) $(LIBIP_SRCS) mempool.c istream.c btrie.c
LIB_HDRS = $(LIBDNS_HDRS) $(LIBIP_HDRS) mempool.h istream.h btrie.h
LIB_OBJS = $(LIBDNS_OBJS) $(LIBIP_OBJS) mempool.o istream.o btrie.o
LIB_GSRC = $(LIBDNS_GSRC) $(LIBIP_GSRC)
RBLDNSD_SRCS = rbldnsd.c rbldnsd_zones.c rbldnsd_packet.c \
rbldnsd_ip4set.c rbldnsd_ip4tset.c rbldnsd_ip4trie.c \
rbldnsd_ip6tset.c rbldnsd_ip6trie.c rbldnsd_dnset.c \
rbldnsd_generic.c rbldnsd_combined.c rbldnsd_acl.c \
rbldnsd_util.c
RBLDNSD_HDRS = rbldnsd.h
RBLDNSD_OBJS = $(RBLDNSD_SRCS:.c=.o) lib$(NAME).a
MISC = configure configure.lib \
$(NAME).8 qsort.c Makefile.in dns_maketab.awk contrib/rpm/$(NAME).spec \
NEWS TODO CHANGES-0.81 README.user \
rbldnsd.py
TESTS = tests.py $(wildcard test_*.py)
DEBFILES = contrib/debian/changelog contrib/debian/copyright contrib/debian/rules contrib/debian/control \
contrib/debian/postinst contrib/debian/$(NAME).default contrib/debian/$(NAME).init
SRCS = $(LIB_SRCS) $(RBLDNSD_SRCS)
GSRC = $(LIB_GSRC)
HDRS = $(LIB_HDRS) $(RBLDNSD_HDRS)
DISTFILES = $(SRCS) $(HDRS) $(MISC) $(TESTS)
SELF_TESTS = btrie.test
all: $(NAME)
$(NAME): $(RBLDNSD_OBJS)
$(LD) $(LDFLAGS) -o $@ $(RBLDNSD_OBJS) $(LIBS)
lib$(NAME).a: $(LIB_OBJS)
-rm -f $@
$(AR) $(ARFLAGS) $@ $(LIB_OBJS)
$(RANLIB) $@
.SUFFIXES: .c .o
COMPILE = $(CC) $(CFLAGS) $(DEFS) -c $<
.c.o:
$(COMPILE)
dns_nametab.c: dns.h dns_maketab.awk
$(AWK) -f dns_maketab.awk dns.h > [email protected]
mv -f [email protected] $@
rbldnsd.o: rbldnsd.c NEWS
@echo
@echo \ $(NAME) VERSION="\"$(VERSION) ($(VERSION_DATE))\""
@echo
$(COMPILE) -DVERSION="\"$(VERSION) ($(VERSION_DATE))\""
clean:
-rm -f $(RBLDNSD_OBJS) $(LIB_OBJS) lib$(NAME).a $(GSRC) config.log
-rm -f $(SELF_TESTS)
distclean: clean
-rm -f $(NAME) config.h Makefile config.status *.py[co]
spec:
@sed "s/^Version:.*/Version: $(VERSION)/" contrib/rpm/$(NAME).spec \
> contrib/rpm/$(NAME).spec.tmp
@set -e; \
if cmp contrib/rpm/$(NAME).spec contrib/rpm/$(NAME).spec.tmp ; then \
rm -f contrib/rpm/$(NAME).spec.tmp; \
else \
echo "Updating $(NAME).spec ($(VERSION))" ; \
mv -f contrib/rpm/$(NAME).spec.tmp contrib/rpm/$(NAME).spec ; \
fi
dist: $(NAME)-$(VERSION).tar.gz
$(NAME)-$(VERSION).tar.gz: $(DISTFILES)
$(GNUTAR) -czf $@ --transform='s|^|$(NAME)-$(VERSION)/|' \
$(DISTFILES) $(DEBFILES)
depend dep deps: $(SRCS) $(GSRC)
@echo Generating deps for:
@echo \ $(SRCS) $(GSRC)
@sed '/^# depend/q' Makefile.in > Makefile.tmp
@$(CC) $(CFLAGS) -MM $(SRCS) $(GSRC) | \
sed 's/^\(btrie\).o:/\1.o \1.test:/' >> Makefile.tmp
@set -e; \
if cmp Makefile.tmp Makefile.in ; then \
echo Makefile.in unchanged; \
rm -f Makefile.tmp; \
else \
echo Updating Makfile.in; \
mv -f Makefile.tmp Makefile.in ; \
fi
config.h Makefile: configure configure.lib Makefile.in NEWS
./configure
@echo
@echo Please rerun make >&2
@exit 1
# tests
.PHONY: check check-python-tests check-selftests
test: check-selftests check-python-tests
check: check-selftests check-python-tests
check-selftests: $(SELF_TESTS)
@set -e; for t in $(SELF_TESTS); do \
echo =============================================================; \
echo Running $$t; \
./$$t; \
done
check-python-tests: $(NAME)
@echo =============================================================
@echo Running tests.py
@$(PYTHON) tests.py
.SUFFIXES: .test
.c.test:
$(CC) $(CFLAGS) $(DEFS) -DTEST -o $@ $<
# depend
dns_ptodn.o: dns_ptodn.c dns.h
dns_dntop.o: dns_dntop.c dns.h
dns_dntol.o: dns_dntol.c dns.h
dns_dnlen.o: dns_dnlen.c dns.h
dns_dnlabels.o: dns_dnlabels.c dns.h
dns_dnequ.o: dns_dnequ.c dns.h
dns_dnreverse.o: dns_dnreverse.c dns.h
dns_findname.o: dns_findname.c dns.h
ip4parse.o: ip4parse.c ip4addr.h config.h
ip4atos.o: ip4atos.c ip4addr.h config.h
ip4mask.o: ip4mask.c ip4addr.h config.h
ip6addr.o: ip6addr.c ip6addr.h
mempool.o: mempool.c mempool.h
istream.o: istream.c config.h istream.h
btrie.o btrie.test: btrie.c btrie.h config.h mempool.h
rbldnsd.o: rbldnsd.c rbldnsd.h config.h ip4addr.h ip6addr.h dns.h \
mempool.h
rbldnsd_zones.o: rbldnsd_zones.c rbldnsd.h config.h ip4addr.h ip6addr.h \
dns.h mempool.h istream.h
rbldnsd_packet.o: rbldnsd_packet.c rbldnsd.h config.h ip4addr.h ip6addr.h \
dns.h mempool.h
rbldnsd_ip4set.o: rbldnsd_ip4set.c rbldnsd.h config.h ip4addr.h ip6addr.h \
dns.h mempool.h qsort.c
rbldnsd_ip4tset.o: rbldnsd_ip4tset.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h qsort.c
rbldnsd_ip4trie.o: rbldnsd_ip4trie.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h btrie.h
rbldnsd_ip6tset.o: rbldnsd_ip6tset.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h qsort.c
rbldnsd_ip6trie.o: rbldnsd_ip6trie.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h btrie.h
rbldnsd_dnset.o: rbldnsd_dnset.c rbldnsd.h config.h ip4addr.h ip6addr.h \
dns.h mempool.h qsort.c
rbldnsd_generic.o: rbldnsd_generic.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h qsort.c
rbldnsd_combined.o: rbldnsd_combined.c rbldnsd.h config.h ip4addr.h \
ip6addr.h dns.h mempool.h
rbldnsd_acl.o: rbldnsd_acl.c rbldnsd.h config.h ip4addr.h ip6addr.h dns.h \
mempool.h btrie.h
rbldnsd_util.o: rbldnsd_util.c rbldnsd.h config.h ip4addr.h ip6addr.h \
dns.h mempool.h
dns_nametab.o: dns_nametab.c dns.h