1 JSON11_LIBS = $(top_srcdir)/ext/json11/libjson11.la
2 PROBDS_LIBS = $(top_srcdir)/ext/probds/libprobds.la
4 AM_CPPFLAGS = $(LUA_CFLAGS) $(YAHTTP_CFLAGS) $(BOOST_CPPFLAGS) $(LIBSODIUM_CFLAGS) $(NET_SNMP_CFLAGS) $(LIBCAP_CFLAGS) $(SANITIZER_FLAGS) -O3 -Wall -pthread -DSYSCONFDIR=\"${sysconfdir}\" $(SYSTEMD_CFLAGS)
7 -I$(top_srcdir)/ext/json11 \
12 -DSYSCONFDIR=\"$(sysconfdir)\" \
13 -DPKGLIBDIR=\"$(pkglibdir)\" \
14 -DLOCALSTATEDIR=\"$(socketdir)\"
18 -DNODCACHEDIR=\"$(nodcachedir)\"
30 ACLOCAL_AMFLAGS = -I m4
32 BUILT_SOURCES=htmlfiles.h \
35 CLEANFILES = htmlfiles.h \
48 AM_CPPFLAGS +=$(LUA_CFLAGS)
58 effective_tld_names.dat \
62 malloctrace.cc malloctrace.hh \
65 mtasker_fcontext.cc mtasker_ucontext.cc \
67 opensslsigners.hh opensslsigners.cc \
69 dnstap.proto dnstap.cc dnstap.hh fstrm_logger.cc fstrm_logger.hh rec-dnstap.hh \
73 pdns-recursor.service.in \
75 builder-support/gen-version
78 for file in $$(find $(distdir)/docs -type l); do \
79 t=`stat -c%N $$file | awk '{print $$NF}' | sed "s/'//g"` ; \
80 ln -fs ../$$t $$file; \
83 sbin_PROGRAMS = pdns_recursor
84 bin_PROGRAMS = rec_control
89 noinst_PROGRAMS = testrunner
90 TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
94 @echo "Unit tests are not enabled"
95 @echo "Run ./configure --enable-unit-tests"
98 pdns_recursor_SOURCES = \
101 base32.cc base32.hh \
102 base64.cc base64.hh \
104 capabilities.cc capabilities.hh \
108 dns_random.hh dns_random.cc \
111 dnsname.cc dnsname.hh \
113 dnsparser.hh dnsparser.cc \
114 dnsrecords.cc dnsrecords.hh \
115 dnssecinfra.hh dnssecinfra.cc \
117 dnswriter.cc dnswriter.hh \
118 ednsoptions.cc ednsoptions.hh \
119 ednssubnet.cc ednssubnet.hh \
120 filterpo.cc filterpo.hh \
121 fstrm_logger.cc fstrm_logger.hh \
122 gettime.cc gettime.hh \
123 gss_context.cc gss_context.hh \
124 iputils.hh iputils.cc \
129 logger.hh logger.cc \
130 lua-base4.cc lua-base4.hh \
131 lua-recursor4.cc lua-recursor4.hh \
132 lua-recursor4-ffi.hh \
137 mtasker_context.cc mtasker_context.hh \
139 negcache.hh negcache.cc \
141 opensslsigners.cc opensslsigners.hh \
146 protobuf.cc protobuf.hh \
147 proxy-protocol.cc proxy-protocol.hh \
148 pubsuffix.hh pubsuffix.cc \
151 rcpgenerator.cc rcpgenerator.hh \
153 rec-lua-conf.hh rec-lua-conf.cc \
154 rec-protobuf.cc rec-protobuf.hh \
155 rec-snmp.hh rec-snmp.cc \
156 rec_channel.cc rec_channel.hh rec_metrics.hh \
158 recpacketcache.cc recpacketcache.hh \
159 recursor_cache.cc recursor_cache.hh \
161 remote_logger.cc remote_logger.hh \
162 resolver.hh resolver.cc \
164 responsestats.hh responsestats.cc \
167 rpzloader.cc rpzloader.hh \
168 secpoll-recursor.cc secpoll-recursor.hh \
169 secpoll.cc secpoll.hh \
172 snmp-agent.hh snmp-agent.cc \
173 sortlist.cc sortlist.hh \
176 syncres.cc syncres.hh \
177 threadname.hh threadname.cc \
178 tsigverifier.cc tsigverifier.hh \
182 uuid-utils.hh uuid-utils.cc \
183 validate.cc validate.hh validate-recursor.cc validate-recursor.hh \
184 version.cc version.hh \
185 webserver.cc webserver.hh \
186 ws-api.cc ws-api.hh \
187 ws-recursor.cc ws-recursor.hh \
189 zoneparser-tng.cc zoneparser-tng.hh
192 BUILT_SOURCES += lua.hpp
193 nodist_pdns_recursor_SOURCES = lua.hpp
196 CLEANFILES += lua.hpp
198 pdns_recursor_LDADD = \
202 $(BOOST_CONTEXT_LIBS) \
206 $(BOOST_SYSTEM_LIBS) \
210 pdns_recursor_LDFLAGS = $(AM_LDFLAGS) \
211 $(LIBCRYPTO_LDFLAGS) $(BOOST_CONTEXT_LDFLAGS) \
212 $(BOOST_SYSTEM_LDFLAGS)
215 pdns_recursor_SOURCES += nod.hh nod.cc
216 pdns_recursor_LDADD += \
217 $(BOOST_FILESYSTEM_LIBS)
218 pdns_recursor_LDFLAGS += \
219 $(BOOST_FILESYSTEM_LDFLAGS)
222 testrunner_SOURCES = \
225 base64.cc base64.hh \
228 dns_random.cc dns_random.hh \
230 dnsname.cc dnsname.hh \
231 dnsparser.hh dnsparser.cc \
235 dnswriter.cc dnswriter.hh \
236 ednscookies.cc ednscookies.hh \
237 ednsoptions.cc ednsoptions.hh \
238 ednssubnet.cc ednssubnet.hh \
239 filterpo.cc filterpo.hh \
240 gettime.cc gettime.hh \
241 gss_context.cc gss_context.hh \
242 iputils.cc iputils.hh \
244 logger.cc logger.hh \
247 negcache.hh negcache.cc \
251 opensslsigners.cc opensslsigners.hh \
253 protobuf.cc protobuf.hh \
256 rec-protobuf.cc rec-protobuf.hh \
257 recpacketcache.cc recpacketcache.hh \
258 recursor_cache.cc recursor_cache.hh \
260 rpzloader.cc rpzloader.hh \
261 resolver.hh resolver.cc \
268 syncres.cc syncres.hh \
269 test-arguments_cc.cc \
273 test-dnsrecordcontent.cc \
274 test-dns_random_hh.cc \
276 test-dnsparser_hh.cc \
277 test-dnsrecords_cc.cc \
278 test-ednsoptions_cc.cc \
279 test-filterpo_cc.cc \
285 test-negcache_cc.cc \
286 test-packetcache_hh.cc \
287 test-rcpgenerator_cc.cc \
288 test-recpacketcache_cc.cc \
289 test-recursorcache_cc.cc \
290 test-rpzloader_cc.cc \
295 test-syncres_cc1.cc \
296 test-syncres_cc2.cc \
297 test-syncres_cc3.cc \
298 test-syncres_cc4.cc \
299 test-syncres_cc5.cc \
300 test-syncres_cc6.cc \
301 test-syncres_cc7.cc \
302 test-syncres_cc8.cc \
303 test-syncres_cc9.cc \
307 threadname.hh threadname.cc \
308 tsigverifier.cc tsigverifier.hh \
310 validate.cc validate.hh \
311 validate-recursor.cc validate-recursor.hh \
313 zoneparser-tng.cc zoneparser-tng.hh
315 testrunner_LDFLAGS = \
317 $(BOOST_CONTEXT_LDFLAGS) \
318 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
319 $(LIBCRYPTO_LDFLAGS) \
320 $(BOOST_SYSTEM_LDFLAGS)
323 $(BOOST_CONTEXT_LIBS) \
324 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
327 $(BOOST_SYSTEM_LIBS) \
332 testrunner_SOURCES += nod.hh nod.cc \
335 testrunner_LDADD += \
336 $(BOOST_FILESYSTEM_LIBS)
337 testrunner_LDFLAGS += \
338 $(BOOST_FILESYSTEM_LDFLAGS)
342 pdns_recursor_SOURCES += \
344 pdns_recursor_LDADD += $(LIBSODIUM_LIBS)
345 testrunner_SOURCES += \
347 testrunner_LDADD += $(LIBSODIUM_LIBS)
351 pdns_recursor_SOURCES += \
353 pdns_recursor_LDADD += $(LIBDECAF_LIBS)
357 pdns_recursor_SOURCES += \
360 pdns_recursor_LDFLAGS += -rdynamic
364 pdns_recursor_LDADD += $(LUA_LIBS)
368 pdns_recursor_SOURCES += kqueuemplexer.cc
369 testrunner_SOURCES += kqueuemplexer.cc
373 pdns_recursor_SOURCES += epollmplexer.cc
374 testrunner_SOURCES += epollmplexer.cc
378 pdns_recursor_SOURCES += \
381 testrunner_SOURCES += \
388 dnsmessage.pb.cc: dnsmessage.proto
389 $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
392 dnstap.pb.cc: dnstap.proto
393 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
397 BUILT_SOURCES += dnsmessage.pb.cc
398 pdns_recursor_LDADD += $(PROTOBUF_LIBS)
399 nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
400 nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
403 BUILT_SOURCES += dnstap.pb.cc
404 pdns_recursor.$(OBJEXT): dnstap.pb.cc dnsmessage.pb.cc
405 testrunner$(OBJEXT): dnstap.pb.cc dnsmessage.pb.cc
406 nodist_pdns_recursor_SOURCES += dnstap.pb.cc dnstap.pb.h
407 nodist_testrunner_SOURCES += dnstap.pb.cc dnstap.pb.h
409 pdns_recursor.$(OBJEXT): dnsmessage.pb.cc
410 testrunner$(OBJEXT): dnsmessage.pb.cc
413 testrunner_LDADD += $(PROTOBUF_LIBS)
419 pdns_recursor_SOURCES += \
420 dnstap.cc dnstap.hh rec-dnstap.hh
422 pdns_recursor_LDADD += \
426 rec_control_SOURCES = \
427 arguments.cc arguments.hh \
428 dnsname.hh dnsname.cc \
433 rec_channel.cc rec_channel.hh \
437 dnslabeltext.cc: dnslabeltext.rl
438 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
440 curl_verbose = $(curl_verbose_$(V))
441 curl_verbose_ = $(curl_verbose_$(AM_DEFAULT_VERBOSITY))
442 curl_verbose_0 = @echo " CURL " $@;
443 $(srcdir)/effective_tld_names.dat:
444 $(curl_verbose)if ! curl -s -S https://publicsuffix.org/list/public_suffix_list.dat > $@; then rm -f $@; exit 1; fi
446 pubsuffix.cc: $(srcdir)/effective_tld_names.dat
447 $(AM_V_GEN)./mkpubsuffixcc
450 sysconf_DATA = recursor.conf-dist
452 recursor.conf-dist: pdns_recursor
453 $(AM_V_GEN)./pdns_recursor --config > $@
456 MANPAGES=pdns_recursor.1 \
459 dist_man_MANS=$(MANPAGES)
463 $(MANPAGES): %: docs/manpages/%.rst .venv
464 .venv/bin/python -msphinx -b man docs . $<
465 endif # if !HAVE_MANPAGES
467 .venv: docs/requirements.txt
469 .venv/bin/pip install -U pip setuptools setuptools-git
470 .venv/bin/pip install -r docs/requirements.txt
472 html-docs: docs/** .venv
473 .venv/bin/python -msphinx -b html docs html-docs
475 latex/PowerDNS-Recursor.pdf: docs/** .venv
476 .venv/bin/python -msphinx -M latexpdf docs .
478 PowerDNS-Recursor.pdf: latex/PowerDNS-Recursor.pdf
481 html-docs.tar.bz2: html-docs
484 all-docs: PowerDNS-Recursor.pdf html-docs html-docs.tar.bz2
486 upload-docs: all-docs
487 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
488 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
489 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./PowerDNS-Recursor.pdf web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
491 else # if HAVE_VIRTUALENV
493 echo "You need virtualenv to generate the manpages"
496 PowerDNS-Recursor.pdf:
497 echo "You need virtualenv to generate the PDF"
501 echo "You need virtualenv to generate the HTML docs"
506 pdns-recursor.service: pdns-recursor.service.in
507 $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
508 if !HAVE_SYSTEMD_LOCK_PERSONALITY
509 $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
511 if !HAVE_SYSTEMD_PRIVATE_DEVICES
512 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@
514 if !HAVE_SYSTEMD_PRIVATE_TMP
515 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@
517 if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS
518 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@
520 if !HAVE_SYSTEMD_PROTECT_HOME
521 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@
523 if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES
524 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@
526 if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES
527 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@
529 if !HAVE_SYSTEMD_PROTECT_SYSTEM
530 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@
532 if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES
533 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@
535 if !HAVE_SYSTEMD_RESTRICT_NAMESPACES
536 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@
538 if !HAVE_SYSTEMD_RESTRICT_REALTIME
539 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@
541 if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES
542 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@
544 if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER
545 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@
548 pdns-recursor@.service: pdns-recursor.service
549 $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \
550 -e 's!Recursor!& %i!' \
553 systemdsystemunitdir = $(SYSTEMD_DIR)
555 systemdsystemunit_DATA = \
556 pdns-recursor.service \
557 pdns-recursor@.service
560 pdns-recursor.service \
561 pdns-recursor@.service