]>
Commit | Line | Data |
---|---|---|
fdc3ea42 | 1 | AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFLAGS) $(FSTRM_CFLAGS) $(YAHTTP_CFLAGS) $(SANITIZER_FLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) -DSYSCONFDIR=\"${sysconfdir}\" |
50bed881 | 2 | |
91487eb9 PL |
3 | ACLOCAL_AMFLAGS = -I m4 |
4 | ||
f8204e9e | 5 | SUBDIRS=ext/yahttp |
bbfefc98 | 6 | |
50169e30 CH |
7 | CLEANFILES = \ |
8 | dnsmessage.pb.cc \ | |
9 | dnsmessage.pb.h \ | |
10 | htmlfiles.h.tmp \ | |
11 | htmlfiles.h \ | |
12 | dnstap.pb.cc \ | |
13 | dnstap.pb.h | |
37a2da85 | 14 | |
bbfefc98 | 15 | dnslabeltext.cc: dnslabeltext.rl |
30bfe7f6 | 16 | $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc |
4676400a | 17 | |
56872c22 PL |
18 | BUILT_SOURCES=htmlfiles.h \ |
19 | dnslabeltext.cc | |
a1f81e3b | 20 | |
38b86118 PL |
21 | htmlfiles.h: $(srcdir)/html/* |
22 | $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp | |
23 | @mv $@.tmp $@ | |
bbfefc98 | 24 | |
7cc65f8a SH |
25 | SRC_JS_FILES := $(wildcard src_js/*.js) |
26 | MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES)) | |
27 | ||
28 | html/js/%.min.js: src_js/%.js | |
29 | uglifyjs $< > $@ | |
30 | ||
31 | min_js: $(MIN_JS_FILES) | |
32 | ||
4ed8dfeb | 33 | if HAVE_RE2 |
34 | AM_CPPFLAGS += $(RE2_CFLAGS) | |
35 | endif | |
36 | ||
a227f47d RG |
37 | if HAVE_DNS_OVER_TLS |
38 | if HAVE_LIBSSL | |
39 | AM_CPPFLAGS += $(LIBSSL_CFLAGS) | |
40 | endif | |
41 | ||
42 | if HAVE_GNUTLS | |
43 | AM_CPPFLAGS += $(GNUTLS_CFLAGS) | |
44 | endif | |
45 | endif | |
4ed8dfeb | 46 | |
190aaf91 PL |
47 | EXTRA_DIST=COPYING \ |
48 | dnslabeltext.rl \ | |
994c0ab3 | 49 | dnsdistconf.lua \ |
59c83cf6 | 50 | dnsmessage.proto \ |
82a91ddf | 51 | dnstap.proto \ |
994c0ab3 | 52 | README.md \ |
25553371 | 53 | delaypipe.cc delaypipe.hh \ |
994c0ab3 | 54 | html \ |
b3bcfb63 | 55 | contrib \ |
babc4bab SH |
56 | ext/incbin/UNLICENSE \ |
57 | incfiles \ | |
6ab65223 | 58 | src_js \ |
65613131 | 59 | dnsdist.service.in \ |
d45189b7 RG |
60 | lua_hpp.mk \ |
61 | bpf-filter.main.ebpf \ | |
62 | bpf-filter.qname.ebpf \ | |
9f4eb5cc | 63 | bpf-filter.ebpf.src \ |
0e663c3b RG |
64 | DNSDIST-MIB.txt \ |
65 | devpollmplexer.cc \ | |
66 | epollmplexer.cc \ | |
67 | kqueuemplexer.cc \ | |
8670e40d PL |
68 | portsmplexer.cc \ |
69 | builder-support/gen-version | |
bbfefc98 | 70 | |
71 | bin_PROGRAMS = dnsdist | |
d2143283 PL |
72 | |
73 | if UNIT_TESTS | |
74 | noinst_PROGRAMS = testrunner | |
3c2ea9e5 RG |
75 | TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)' |
76 | TESTS=testrunner | |
77 | else | |
78 | check-local: | |
79 | @echo "Unit tests are not enabled" | |
80 | @echo "Run ./configure --enable-unit-tests" | |
ca404e94 RG |
81 | endif |
82 | ||
ca9836cb PL |
83 | dnsdist-web.$(OBJEXT): htmlfiles.h |
84 | ||
bbfefc98 | 85 | dnsdist_SOURCES = \ |
6ee9a5a2 | 86 | ascii.hh \ |
1489accc | 87 | base64.hh \ |
87b515ed | 88 | bpf-filter.cc bpf-filter.hh \ |
05f4003d | 89 | cachecleaner.hh \ |
f12666f2 | 90 | capabilities.cc capabilities.hh \ |
77f8ae1a | 91 | dns.cc dns.hh \ |
11e1e08b | 92 | dnscrypt.cc dnscrypt.hh \ |
bbfefc98 | 93 | dnsdist.cc dnsdist.hh \ |
87b515ed | 94 | dnsdist-dynbpf.cc dnsdist-dynbpf.hh \ |
886e2cf2 | 95 | dnsdist-cache.cc dnsdist-cache.hh \ |
96b092a7 | 96 | dnsdist-carbon.cc \ |
b5521206 | 97 | dnsdist-console.cc dnsdist-console.hh \ |
11e1e08b | 98 | dnsdist-dnscrypt.cc \ |
dc2fd93a | 99 | dnsdist-dynblocks.hh \ |
ca404e94 | 100 | dnsdist-ecs.cc dnsdist-ecs.hh \ |
cf48b0ce | 101 | dnsdist-lua.hh dnsdist-lua.cc \ |
6bb38cd6 RG |
102 | dnsdist-lua-actions.cc \ |
103 | dnsdist-lua-bindings.cc \ | |
104 | dnsdist-lua-bindings-dnsquestion.cc \ | |
105 | dnsdist-lua-inspection.cc \ | |
106 | dnsdist-lua-rules.cc \ | |
107 | dnsdist-lua-vars.cc \ | |
ec469dd7 | 108 | dnsdist-protobuf.cc dnsdist-protobuf.hh \ |
03b00917 | 109 | dnsdist-rings.cc dnsdist-rings.hh \ |
5f2e235c | 110 | dnsdist-rules.hh \ |
5d4e1ef8 | 111 | dnsdist-secpoll.cc dnsdist-secpoll.hh \ |
9f4eb5cc | 112 | dnsdist-snmp.cc dnsdist-snmp.hh \ |
8a5d5053 | 113 | dnsdist-tcp.cc \ |
50bed881 | 114 | dnsdist-web.cc \ |
53c57da7 | 115 | dnsdist-xpf.cc dnsdist-xpf.hh \ |
bbfefc98 | 116 | dnslabeltext.cc \ |
117 | dnsname.cc dnsname.hh \ | |
ca404e94 | 118 | dnsparser.hh dnsparser.cc \ |
bbfefc98 | 119 | dnswriter.cc dnswriter.hh \ |
120 | dolog.hh \ | |
5c3b5e7f | 121 | ednsoptions.cc ednsoptions.hh \ |
ff73f02b | 122 | ednscookies.cc ednscookies.hh \ |
ca404e94 | 123 | ednssubnet.cc ednssubnet.hh \ |
82a91ddf | 124 | fstrm_logger.cc fstrm_logger.hh \ |
85c7ca75 | 125 | gettime.cc gettime.hh \ |
0e663c3b | 126 | htmlfiles.h \ |
bbfefc98 | 127 | iputils.cc iputils.hh \ |
0e41337b | 128 | lock.hh \ |
bbfefc98 | 129 | misc.cc misc.hh \ |
0e663c3b | 130 | mplexer.hh \ |
bbfefc98 | 131 | namespaces.hh \ |
132 | pdnsexception.hh \ | |
d9d3f9c1 | 133 | protobuf.cc protobuf.hh \ |
82a91ddf | 134 | dnstap.cc dnstap.hh \ |
bbfefc98 | 135 | qtype.cc qtype.hh \ |
ec469dd7 | 136 | remote_logger.cc remote_logger.hh \ |
926444e2 | 137 | pollmplexer.cc \ |
ecbe9133 | 138 | sholder.hh \ |
9f4eb5cc | 139 | snmp-agent.cc snmp-agent.hh \ |
bbfefc98 | 140 | sodcrypto.cc sodcrypto.hh \ |
f8204e9e | 141 | sstuff.hh \ |
71c94675 | 142 | statnode.cc statnode.hh \ |
a227f47d | 143 | tcpiohandler.cc tcpiohandler.hh \ |
519f5484 | 144 | threadname.hh threadname.cc \ |
d61aa945 | 145 | uuid-utils.hh uuid-utils.cc \ |
5cc8371b | 146 | xpf.cc xpf.hh \ |
f8204e9e PL |
147 | ext/luawrapper/include/LuaContext.hpp \ |
148 | ext/json11/json11.cpp \ | |
149 | ext/json11/json11.hpp \ | |
87b515ed RG |
150 | ext/incbin/incbin.h \ |
151 | ext/libbpf/libbpf.h | |
bbfefc98 | 152 | |
153 | dnsdist_LDFLAGS = \ | |
154 | $(AM_LDFLAGS) \ | |
bfb7cc84 | 155 | $(PROGRAM_LDFLAGS) \ |
50bed881 | 156 | -pthread |
bbfefc98 | 157 | |
158 | dnsdist_LDADD = \ | |
a6158e7a | 159 | $(LUA_LIBS) \ |
d9de8b61 | 160 | $(LIBEDIT_LIBS) \ |
a6158e7a RK |
161 | $(RT_LIBS) \ |
162 | $(YAHTTP_LIBS) \ | |
e85e4d88 | 163 | $(LIBSODIUM_LIBS) \ |
82a91ddf | 164 | $(FSTRM_LIBS) \ |
6ab65223 | 165 | $(SANITIZER_FLAGS) \ |
9f4eb5cc | 166 | $(SYSTEMD_LIBS) \ |
fdc3ea42 RG |
167 | $(NET_SNMP_LIBS) \ |
168 | $(LIBCAP_LIBS) | |
bbfefc98 | 169 | |
4ed8dfeb | 170 | if HAVE_RE2 |
171 | dnsdist_LDADD += $(RE2_LIBS) | |
172 | endif | |
173 | ||
a227f47d RG |
174 | if HAVE_DNS_OVER_TLS |
175 | if HAVE_GNUTLS | |
176 | dnsdist_LDADD += -lgnutls | |
177 | endif | |
178 | ||
179 | if HAVE_LIBSSL | |
180 | dnsdist_LDADD += $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) | |
181 | endif | |
182 | endif | |
183 | ||
65613131 PL |
184 | if !HAVE_LUA_HPP |
185 | BUILT_SOURCES += lua.hpp | |
186 | nodist_dnsdist_SOURCES = lua.hpp | |
187 | CLEANFILES += lua.hpp | |
188 | endif | |
b2eccf5f | 189 | |
37a2da85 PL |
190 | if HAVE_PROTOBUF |
191 | if HAVE_PROTOC | |
b2eccf5f | 192 | dnsmessage.pb.cc: dnsmessage.proto |
38b86118 | 193 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< |
b2eccf5f | 194 | |
82a91ddf CH |
195 | dnstap.pb.cc: dnstap.proto |
196 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< | |
197 | ||
198 | BUILT_SOURCES += dnsmessage.pb.cc dnstap.pb.cc | |
37a2da85 | 199 | |
82a91ddf | 200 | nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h dnstap.pb.cc dnstap.pb.h |
d8c19b98 | 201 | dnsdist_LDADD += $(PROTOBUF_LIBS) |
37a2da85 | 202 | |
82a91ddf | 203 | dnsdist.$(OBJEXT): dnsmessage.pb.cc dnstap.pb.cc |
37a2da85 | 204 | endif |
d8c19b98 | 205 | endif |
ca404e94 | 206 | |
0e663c3b RG |
207 | if HAVE_FREEBSD |
208 | dnsdist_SOURCES += kqueuemplexer.cc | |
209 | endif | |
210 | ||
211 | if HAVE_LINUX | |
212 | dnsdist_SOURCES += epollmplexer.cc | |
213 | endif | |
214 | ||
215 | if HAVE_SOLARIS | |
216 | dnsdist_SOURCES += \ | |
217 | devpollmplexer.cc \ | |
218 | portsmplexer.cc | |
219 | endif | |
220 | ||
ca404e94 | 221 | testrunner_SOURCES = \ |
11e1e08b RG |
222 | base64.hh \ |
223 | dns.hh \ | |
e27e17c3 | 224 | test-base64_cc.cc \ |
94e4d723 | 225 | test-delaypipe_hh.cc \ |
47698274 | 226 | test-dnscrypt_cc.cc \ |
11e1e08b | 227 | test-dnsdist_cc.cc \ |
1d3ba133 | 228 | test-dnsdistdynblocks_hh.cc \ |
886e2cf2 | 229 | test-dnsdistpacketcache_cc.cc \ |
cfe4b655 | 230 | test-dnsdistrings_cc.cc \ |
05f4003d | 231 | test-dnsdistrules_cc.cc \ |
47698274 | 232 | test-dnsparser_cc.cc \ |
0047d734 | 233 | test-iputils_hh.cc \ |
05f4003d | 234 | cachecleaner.hh \ |
11e1e08b | 235 | dnsdist.hh \ |
886e2cf2 | 236 | dnsdist-cache.cc dnsdist-cache.hh \ |
ca404e94 | 237 | dnsdist-ecs.cc dnsdist-ecs.hh \ |
53c57da7 | 238 | dnsdist-xpf.cc dnsdist-xpf.hh \ |
11e1e08b | 239 | dnscrypt.cc dnscrypt.hh \ |
ca404e94 RG |
240 | dnslabeltext.cc \ |
241 | dnsname.cc dnsname.hh \ | |
242 | dnsparser.hh dnsparser.cc \ | |
243 | dnswriter.cc dnswriter.hh \ | |
244 | dolog.hh \ | |
5c3b5e7f | 245 | ednsoptions.cc ednsoptions.hh \ |
ff73f02b | 246 | ednscookies.cc ednscookies.hh \ |
ca404e94 | 247 | ednssubnet.cc ednssubnet.hh \ |
85c7ca75 | 248 | gettime.cc gettime.hh \ |
ca404e94 RG |
249 | iputils.cc iputils.hh \ |
250 | misc.cc misc.hh \ | |
251 | namespaces.hh \ | |
252 | pdnsexception.hh \ | |
253 | qtype.cc qtype.hh \ | |
254 | sholder.hh \ | |
e27e17c3 | 255 | sodcrypto.cc \ |
ca404e94 | 256 | sstuff.hh \ |
94e4d723 | 257 | threadname.hh threadname.cc \ |
5cc8371b RG |
258 | testrunner.cc \ |
259 | xpf.cc xpf.hh | |
ca404e94 RG |
260 | |
261 | testrunner_LDFLAGS = \ | |
262 | $(AM_LDFLAGS) \ | |
263 | $(PROGRAM_LDFLAGS) \ | |
264 | $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \ | |
265 | -pthread | |
266 | ||
267 | testrunner_LDADD = \ | |
268 | $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \ | |
11e1e08b | 269 | $(LIBSODIUM_LIBS) \ |
82a91ddf | 270 | $(FSTRM_LIBS) \ |
8d06661a | 271 | $(RT_LIBS) \ |
fdc3ea42 RG |
272 | $(SANITIZER_FLAGS) \ |
273 | $(LIBCAP_LIBS) | |
ca404e94 | 274 | |
f68a9074 PL |
275 | MANPAGES=dnsdist.1 |
276 | ||
277 | dist_man_MANS=$(MANPAGES) | |
278 | ||
20d81666 PL |
279 | if HAVE_VIRTUALENV |
280 | if !HAVE_MANPAGES | |
281 | $(MANPAGES): %: docs/manpages/%.rst .venv | |
282 | $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $< | |
283 | endif # if !HAVE_MANPAGES | |
284 | ||
285 | .venv: docs/requirements.txt | |
286 | virtualenv .venv | |
29455e8a | 287 | .venv/bin/pip install -U pip setuptools setuptools-git |
20d81666 PL |
288 | .venv/bin/pip install -r $< |
289 | ||
290 | latex/dnsdist.pdf: docs/** .venv | |
291 | .venv/bin/python -msphinx -M latexpdf docs . | |
292 | ||
293 | dnsdist.pdf: latex/dnsdist.pdf | |
294 | mv $< $@ | |
295 | ||
296 | html-docs.tar.bz2: html-docs | |
297 | tar cjf $@ $< | |
298 | ||
299 | html-docs: docs/** .venv | |
300 | .venv/bin/python -msphinx -b html docs html-docs | |
301 | ||
302 | all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf | |
303 | ||
304 | upload-docs: all-docs | |
60c95446 PL |
305 | rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org |
306 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org | |
307 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org | |
20d81666 PL |
308 | |
309 | else # if HAVE_VIRTUALENV | |
f68a9074 | 310 | $(MANPAGES): |
20d81666 PL |
311 | @echo "You need virtualenv to generate the manpages" |
312 | exit 1 | |
313 | ||
314 | html-docs: %: docs/manpages/%.rst .venv | |
315 | @echo "You need virtualenv to generate the HTML documentation" | |
316 | exit 1 | |
317 | ||
318 | dnsdist.pdf: | |
319 | @echo "You need virtualenv to generate the pdf documentation" | |
f68a9074 | 320 | exit 1 |
f68a9074 | 321 | endif |
6ab65223 PL |
322 | |
323 | if HAVE_SYSTEMD | |
324 | dnsdist.service: dnsdist.service.in | |
325 | $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@ | |
a3dfb540 RG |
326 | if !HAVE_SYSTEMD_LOCK_PERSONALITY |
327 | $(AM_V_GEN)sed -i '' -e '/^LockPersonality/d' $@ | |
328 | endif | |
329 | if !HAVE_SYSTEMD_PRIVATE_DEVICES | |
330 | $(AM_V_GEN)sed -i '' -e '/^PrivateDevices/d' $@ | |
331 | endif | |
332 | if !HAVE_SYSTEMD_PRIVATE_TMP | |
333 | $(AM_V_GEN)sed -i '' -e '/^PrivateTmp/d' $@ | |
334 | endif | |
335 | if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS | |
336 | $(AM_V_GEN)sed -i '' -e '/^ProtectControlGroups/d' $@ | |
337 | endif | |
338 | if !HAVE_SYSTEMD_PROTECT_HOME | |
339 | $(AM_V_GEN)sed -i '' -e '/^ProtectHome/d' $@ | |
340 | endif | |
341 | if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES | |
342 | $(AM_V_GEN)sed -i '' -e '/^ProtectKernelModules/d' $@ | |
343 | endif | |
344 | if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES | |
345 | $(AM_V_GEN)sed -i '' -e '/^ProtectKernelTunables/d' $@ | |
346 | endif | |
347 | if !HAVE_SYSTEMD_PROTECT_SYSTEM | |
348 | $(AM_V_GEN)sed -i '' -e '/^ProtectSystem/d' $@ | |
349 | endif | |
350 | if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES | |
351 | $(AM_V_GEN)sed -i '' -e '/^RestrictAddressFamilies/d' $@ | |
352 | endif | |
353 | if !HAVE_SYSTEMD_RESTRICT_NAMESPACES | |
354 | $(AM_V_GEN)sed -i '' -e '/^RestrictNamespaces/d' $@ | |
355 | endif | |
356 | if !HAVE_SYSTEMD_RESTRICT_REALTIME | |
357 | $(AM_V_GEN)sed -i '' -e '/^RestrictRealtime/d' $@ | |
358 | endif | |
359 | if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES | |
360 | $(AM_V_GEN)sed -i '' -e '/^SystemCallArchitectures/d' $@ | |
361 | endif | |
362 | if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER | |
363 | $(AM_V_GEN)sed -i '' -e '/^SystemCallFilter/d' $@ | |
364 | endif | |
6ab65223 | 365 | |
aa663221 PL |
366 | dnsdist@.service: dnsdist.service |
367 | $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@ | |
368 | ||
6ab65223 PL |
369 | systemdsystemunitdir = $(SYSTEMD_DIR) |
370 | ||
371 | systemdsystemunit_DATA = \ | |
aa663221 PL |
372 | dnsdist.service \ |
373 | dnsdist@.service | |
50169e30 CH |
374 | |
375 | CLEANFILES += \ | |
376 | dnsdist.service \ | |
377 | dnsdist@.service | |
6ab65223 | 378 | endif |
65613131 PL |
379 | |
380 | if !HAVE_LUA_HPP | |
381 | include lua_hpp.mk | |
382 | endif |