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)\"
25 ACLOCAL_AMFLAGS = -I m4
27 BUILT_SOURCES=htmlfiles.h \
30 CLEANFILES = htmlfiles.h \
41 AM_CPPFLAGS +=$(LUA_CFLAGS)
51 effective_tld_names.dat \
55 malloctrace.cc malloctrace.hh \
58 mtasker_fcontext.cc mtasker_ucontext.cc \
60 opensslsigners.hh opensslsigners.cc \
65 pdns-recursor.service.in \
67 builder-support/gen-version
70 for file in $$(find $(distdir)/docs -type l); do \
71 t=`stat -c%N $$file | awk '{print $$NF}' | sed "s/'//g"` ; \
72 ln -fs ../$$t $$file; \
75 sbin_PROGRAMS = pdns_recursor
76 bin_PROGRAMS = rec_control
81 noinst_PROGRAMS = testrunner
82 TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
86 @echo "Unit tests are not enabled"
87 @echo "Run ./configure --enable-unit-tests"
90 pdns_recursor_SOURCES = \
96 capabilities.cc capabilities.hh \
99 dns_random.hh dns_random.cc \
102 dnsname.cc dnsname.hh \
104 dnsparser.hh dnsparser.cc \
105 dnsrecords.cc dnsrecords.hh \
106 dnssecinfra.hh dnssecinfra.cc \
108 dnswriter.cc dnswriter.hh \
109 ednsoptions.cc ednsoptions.hh \
110 ednssubnet.cc ednssubnet.hh \
111 filterpo.cc filterpo.hh \
112 gettime.cc gettime.hh \
113 gss_context.cc gss_context.hh \
114 iputils.hh iputils.cc \
119 logger.hh logger.cc \
120 lua-base4.cc lua-base4.hh \
121 lua-recursor4.cc lua-recursor4.hh \
122 lua-recursor4-ffi.hh \
127 mtasker_context.cc mtasker_context.hh \
129 negcache.hh negcache.cc \
131 opensslsigners.cc opensslsigners.hh \
136 protobuf.cc protobuf.hh \
137 pubsuffix.hh pubsuffix.cc \
140 rcpgenerator.cc rcpgenerator.hh \
142 rec-lua-conf.hh rec-lua-conf.cc \
143 rec-protobuf.cc rec-protobuf.hh \
144 rec-snmp.hh rec-snmp.cc \
145 rec_channel.cc rec_channel.hh rec_metrics.hh \
147 recpacketcache.cc recpacketcache.hh \
148 recursor_cache.cc recursor_cache.hh \
150 remote_logger.cc remote_logger.hh \
151 resolver.hh resolver.cc \
153 responsestats.hh responsestats.cc \
156 rpzloader.cc rpzloader.hh \
157 secpoll-recursor.cc \
158 secpoll-recursor.hh \
161 snmp-agent.hh snmp-agent.cc \
162 sortlist.cc sortlist.hh \
165 syncres.cc syncres.hh \
166 threadname.hh threadname.cc \
167 tsigverifier.cc tsigverifier.hh \
171 uuid-utils.hh uuid-utils.cc \
172 validate.cc validate.hh validate-recursor.cc validate-recursor.hh \
173 version.cc version.hh \
174 webserver.cc webserver.hh \
175 ws-api.cc ws-api.hh \
176 ws-recursor.cc ws-recursor.hh \
178 zoneparser-tng.cc zoneparser-tng.hh
181 BUILT_SOURCES += lua.hpp
182 nodist_pdns_recursor_SOURCES = lua.hpp
183 CLEANFILES += lua.hpp
186 pdns_recursor_LDADD = \
190 $(BOOST_CONTEXT_LIBS) \
194 $(BOOST_SYSTEM_LIBS) \
198 pdns_recursor_LDFLAGS = $(AM_LDFLAGS) \
199 $(LIBCRYPTO_LDFLAGS) $(BOOST_CONTEXT_LDFLAGS) \
200 $(BOOST_SYSTEM_LDFLAGS)
203 pdns_recursor_SOURCES += nod.hh nod.cc
204 pdns_recursor_LDADD += \
205 $(BOOST_FILESYSTEM_LIBS)
206 pdns_recursor_LDFLAGS += \
207 $(BOOST_FILESYSTEM_LDFLAGS)
210 testrunner_SOURCES = \
213 base64.cc base64.hh \
215 dns_random.cc dns_random.hh \
217 dnsname.cc dnsname.hh \
218 dnsparser.hh dnsparser.cc \
222 dnswriter.cc dnswriter.hh \
223 ednscookies.cc ednscookies.hh \
224 ednsoptions.cc ednsoptions.hh \
225 ednssubnet.cc ednssubnet.hh \
226 filterpo.cc filterpo.hh \
227 gettime.cc gettime.hh \
228 gss_context.cc gss_context.hh \
229 iputils.cc iputils.hh \
231 logger.cc logger.hh \
234 negcache.hh negcache.cc \
238 opensslsigners.cc opensslsigners.hh \
240 protobuf.cc protobuf.hh \
243 rec-protobuf.cc rec-protobuf.hh \
244 recpacketcache.cc recpacketcache.hh \
245 recursor_cache.cc recursor_cache.hh \
252 syncres.cc syncres.hh \
253 test-arguments_cc.cc \
257 test-dnsrecordcontent.cc \
258 test-dns_random_hh.cc \
260 test-dnsparser_hh.cc \
261 test-dnsrecords_cc.cc \
262 test-ednsoptions_cc.cc \
263 test-filterpo_cc.cc \
269 test-negcache_cc.cc \
270 test-packetcache_hh.cc \
271 test-rcpgenerator_cc.cc \
272 test-recpacketcache_cc.cc \
273 test-recursorcache_cc.cc \
277 test-syncres_cc1.cc \
278 test-syncres_cc2.cc \
279 test-syncres_cc3.cc \
280 test-syncres_cc4.cc \
281 test-syncres_cc5.cc \
282 test-syncres_cc6.cc \
283 test-syncres_cc7.cc \
284 test-syncres_cc8.cc \
285 test-syncres_cc9.cc \
289 threadname.hh threadname.cc \
290 tsigverifier.cc tsigverifier.hh \
292 validate.cc validate.hh \
293 validate-recursor.cc validate-recursor.hh \
295 zoneparser-tng.cc zoneparser-tng.hh
297 testrunner_LDFLAGS = \
299 $(BOOST_CONTEXT_LDFLAGS) \
300 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
301 $(LIBCRYPTO_LDFLAGS) \
302 $(BOOST_SYSTEM_LDFLAGS)
305 $(BOOST_CONTEXT_LIBS) \
306 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
309 $(BOOST_SYSTEM_LIBS) \
314 testrunner_SOURCES += nod.hh nod.cc \
317 testrunner_LDADD += \
318 $(BOOST_FILESYSTEM_LIBS)
319 testrunner_LDFLAGS += \
320 $(BOOST_FILESYSTEM_LDFLAGS)
324 pdns_recursor_SOURCES += \
326 pdns_recursor_LDADD += $(LIBSODIUM_LIBS)
327 testrunner_SOURCES += \
329 testrunner_LDADD += $(LIBSODIUM_LIBS)
333 pdns_recursor_SOURCES += \
335 pdns_recursor_LDADD += $(LIBDECAF_LIBS)
339 pdns_recursor_SOURCES += \
342 pdns_recursor_LDFLAGS += -rdynamic
346 pdns_recursor_LDADD += $(LUA_LIBS)
350 pdns_recursor_SOURCES += kqueuemplexer.cc
351 testrunner_SOURCES += kqueuemplexer.cc
355 pdns_recursor_SOURCES += epollmplexer.cc
356 testrunner_SOURCES += epollmplexer.cc
360 pdns_recursor_SOURCES += \
363 testrunner_SOURCES += \
370 dnsmessage.pb.cc: dnsmessage.proto
371 $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
373 BUILT_SOURCES += dnsmessage.pb.cc
374 pdns_recursor_LDADD += $(PROTOBUF_LIBS)
375 nodist_pdns_recursor_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
376 pdns_recursor.$(OBJEXT): dnsmessage.pb.cc
378 nodist_testrunner_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
379 testrunner_LDADD += $(PROTOBUF_LIBS)
380 testrunner$(OBJEXT): dnsmessage.pb.cc
385 rec_control_SOURCES = \
386 arguments.cc arguments.hh \
387 dnsname.hh dnsname.cc \
392 rec_channel.cc rec_channel.hh \
396 dnslabeltext.cc: dnslabeltext.rl
397 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
399 curl_verbose = $(curl_verbose_$(V))
400 curl_verbose_ = $(curl_verbose_$(AM_DEFAULT_VERBOSITY))
401 curl_verbose_0 = @echo " CURL " $@;
402 $(srcdir)/effective_tld_names.dat:
403 $(curl_verbose)if ! curl -s -S https://publicsuffix.org/list/public_suffix_list.dat > $@; then rm -f $@; exit 1; fi
405 pubsuffix.cc: $(srcdir)/effective_tld_names.dat
406 $(AM_V_GEN)./mkpubsuffixcc
409 sysconf_DATA = recursor.conf-dist
411 recursor.conf-dist: pdns_recursor
412 $(AM_V_GEN)./pdns_recursor --config > $@
415 MANPAGES=pdns_recursor.1 \
418 dist_man_MANS=$(MANPAGES)
422 $(MANPAGES): %: docs/manpages/%.rst .venv
423 .venv/bin/python -msphinx -b man docs . $<
424 endif # if !HAVE_MANPAGES
426 .venv: docs/requirements.txt
428 .venv/bin/pip install -U pip setuptools setuptools-git
429 .venv/bin/pip install -r docs/requirements.txt
431 html-docs: docs/** .venv
432 .venv/bin/python -msphinx -b html docs html-docs
434 latex/PowerDNS-Recursor.pdf: docs/** .venv
435 .venv/bin/python -msphinx -M latexpdf docs .
437 PowerDNS-Recursor.pdf: latex/PowerDNS-Recursor.pdf
440 html-docs.tar.bz2: html-docs
443 all-docs: PowerDNS-Recursor.pdf html-docs html-docs.tar.bz2
445 upload-docs: all-docs
446 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
447 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
448 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./PowerDNS-Recursor.pdf web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
450 else # if HAVE_VIRTUALENV
452 echo "You need virtualenv to generate the manpages"
455 PowerDNS-Recursor.pdf:
456 echo "You need virtualenv to generate the PDF"
460 echo "You need virtualenv to generate the HTML docs"
465 pdns-recursor.service: pdns-recursor.service.in
466 $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' < $< > $@
467 if !HAVE_SYSTEMD_LOCK_PERSONALITY
468 $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
470 if !HAVE_SYSTEMD_PRIVATE_DEVICES
471 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@
473 if !HAVE_SYSTEMD_PRIVATE_TMP
474 $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@
476 if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS
477 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@
479 if !HAVE_SYSTEMD_PROTECT_HOME
480 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@
482 if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES
483 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@
485 if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES
486 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@
488 if !HAVE_SYSTEMD_PROTECT_SYSTEM
489 $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@
491 if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES
492 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@
494 if !HAVE_SYSTEMD_RESTRICT_NAMESPACES
495 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@
497 if !HAVE_SYSTEMD_RESTRICT_REALTIME
498 $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@
500 if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES
501 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@
503 if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER
504 $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@
507 pdns-recursor@.service: pdns-recursor.service
508 $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \
509 -e 's!Recursor!& %i!' \
512 systemdsystemunitdir = $(SYSTEMD_DIR)
514 systemdsystemunit_DATA = \
515 pdns-recursor.service \
516 pdns-recursor@.service
519 pdns-recursor.service \
520 pdns-recursor@.service