]>
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 \ |
77f8ae1a | 90 | dns.cc dns.hh \ |
11e1e08b | 91 | dnscrypt.cc dnscrypt.hh \ |
bbfefc98 | 92 | dnsdist.cc dnsdist.hh \ |
87b515ed | 93 | dnsdist-dynbpf.cc dnsdist-dynbpf.hh \ |
886e2cf2 | 94 | dnsdist-cache.cc dnsdist-cache.hh \ |
96b092a7 | 95 | dnsdist-carbon.cc \ |
b5521206 | 96 | dnsdist-console.cc dnsdist-console.hh \ |
11e1e08b | 97 | dnsdist-dnscrypt.cc \ |
dc2fd93a | 98 | dnsdist-dynblocks.hh \ |
ca404e94 | 99 | dnsdist-ecs.cc dnsdist-ecs.hh \ |
cf48b0ce | 100 | dnsdist-lua.hh dnsdist-lua.cc \ |
6bb38cd6 RG |
101 | dnsdist-lua-actions.cc \ |
102 | dnsdist-lua-bindings.cc \ | |
103 | dnsdist-lua-bindings-dnsquestion.cc \ | |
104 | dnsdist-lua-inspection.cc \ | |
105 | dnsdist-lua-rules.cc \ | |
106 | dnsdist-lua-vars.cc \ | |
ec469dd7 | 107 | dnsdist-protobuf.cc dnsdist-protobuf.hh \ |
03b00917 | 108 | dnsdist-rings.cc dnsdist-rings.hh \ |
5f2e235c | 109 | dnsdist-rules.hh \ |
5d4e1ef8 | 110 | dnsdist-secpoll.cc dnsdist-secpoll.hh \ |
9f4eb5cc | 111 | dnsdist-snmp.cc dnsdist-snmp.hh \ |
8a5d5053 | 112 | dnsdist-tcp.cc \ |
50bed881 | 113 | dnsdist-web.cc \ |
53c57da7 | 114 | dnsdist-xpf.cc dnsdist-xpf.hh \ |
bbfefc98 | 115 | dnslabeltext.cc \ |
116 | dnsname.cc dnsname.hh \ | |
ca404e94 | 117 | dnsparser.hh dnsparser.cc \ |
bbfefc98 | 118 | dnswriter.cc dnswriter.hh \ |
119 | dolog.hh \ | |
5c3b5e7f | 120 | ednsoptions.cc ednsoptions.hh \ |
ff73f02b | 121 | ednscookies.cc ednscookies.hh \ |
ca404e94 | 122 | ednssubnet.cc ednssubnet.hh \ |
82a91ddf | 123 | fstrm_logger.cc fstrm_logger.hh \ |
85c7ca75 | 124 | gettime.cc gettime.hh \ |
0e663c3b | 125 | htmlfiles.h \ |
bbfefc98 | 126 | iputils.cc iputils.hh \ |
0e41337b | 127 | lock.hh \ |
bbfefc98 | 128 | misc.cc misc.hh \ |
0e663c3b | 129 | mplexer.hh \ |
bbfefc98 | 130 | namespaces.hh \ |
131 | pdnsexception.hh \ | |
d9d3f9c1 | 132 | protobuf.cc protobuf.hh \ |
82a91ddf | 133 | dnstap.cc dnstap.hh \ |
bbfefc98 | 134 | qtype.cc qtype.hh \ |
ec469dd7 | 135 | remote_logger.cc remote_logger.hh \ |
926444e2 | 136 | pollmplexer.cc \ |
ecbe9133 | 137 | sholder.hh \ |
9f4eb5cc | 138 | snmp-agent.cc snmp-agent.hh \ |
bbfefc98 | 139 | sodcrypto.cc sodcrypto.hh \ |
f8204e9e | 140 | sstuff.hh \ |
71c94675 | 141 | statnode.cc statnode.hh \ |
a227f47d | 142 | tcpiohandler.cc tcpiohandler.hh \ |
519f5484 | 143 | threadname.hh threadname.cc \ |
5cc8371b | 144 | xpf.cc xpf.hh \ |
f8204e9e PL |
145 | ext/luawrapper/include/LuaContext.hpp \ |
146 | ext/json11/json11.cpp \ | |
147 | ext/json11/json11.hpp \ | |
87b515ed RG |
148 | ext/incbin/incbin.h \ |
149 | ext/libbpf/libbpf.h | |
bbfefc98 | 150 | |
151 | dnsdist_LDFLAGS = \ | |
152 | $(AM_LDFLAGS) \ | |
bfb7cc84 | 153 | $(PROGRAM_LDFLAGS) \ |
50bed881 | 154 | -pthread |
bbfefc98 | 155 | |
156 | dnsdist_LDADD = \ | |
a6158e7a | 157 | $(LUA_LIBS) \ |
d9de8b61 | 158 | $(LIBEDIT_LIBS) \ |
a6158e7a RK |
159 | $(RT_LIBS) \ |
160 | $(YAHTTP_LIBS) \ | |
e85e4d88 | 161 | $(LIBSODIUM_LIBS) \ |
82a91ddf | 162 | $(FSTRM_LIBS) \ |
6ab65223 | 163 | $(SANITIZER_FLAGS) \ |
9f4eb5cc | 164 | $(SYSTEMD_LIBS) \ |
fdc3ea42 RG |
165 | $(NET_SNMP_LIBS) \ |
166 | $(LIBCAP_LIBS) | |
bbfefc98 | 167 | |
4ed8dfeb | 168 | if HAVE_RE2 |
169 | dnsdist_LDADD += $(RE2_LIBS) | |
170 | endif | |
171 | ||
a227f47d RG |
172 | if HAVE_DNS_OVER_TLS |
173 | if HAVE_GNUTLS | |
174 | dnsdist_LDADD += -lgnutls | |
175 | endif | |
176 | ||
177 | if HAVE_LIBSSL | |
178 | dnsdist_LDADD += $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) | |
179 | endif | |
180 | endif | |
181 | ||
65613131 PL |
182 | if !HAVE_LUA_HPP |
183 | BUILT_SOURCES += lua.hpp | |
184 | nodist_dnsdist_SOURCES = lua.hpp | |
185 | CLEANFILES += lua.hpp | |
186 | endif | |
b2eccf5f | 187 | |
37a2da85 PL |
188 | if HAVE_PROTOBUF |
189 | if HAVE_PROTOC | |
b2eccf5f | 190 | dnsmessage.pb.cc: dnsmessage.proto |
38b86118 | 191 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< |
b2eccf5f | 192 | |
82a91ddf CH |
193 | dnstap.pb.cc: dnstap.proto |
194 | $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $< | |
195 | ||
196 | BUILT_SOURCES += dnsmessage.pb.cc dnstap.pb.cc | |
37a2da85 | 197 | |
82a91ddf | 198 | nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h dnstap.pb.cc dnstap.pb.h |
d8c19b98 | 199 | dnsdist_LDADD += $(PROTOBUF_LIBS) |
37a2da85 | 200 | |
82a91ddf | 201 | dnsdist.$(OBJEXT): dnsmessage.pb.cc dnstap.pb.cc |
37a2da85 | 202 | endif |
d8c19b98 | 203 | endif |
ca404e94 | 204 | |
0e663c3b RG |
205 | if HAVE_FREEBSD |
206 | dnsdist_SOURCES += kqueuemplexer.cc | |
207 | endif | |
208 | ||
209 | if HAVE_LINUX | |
210 | dnsdist_SOURCES += epollmplexer.cc | |
211 | endif | |
212 | ||
213 | if HAVE_SOLARIS | |
214 | dnsdist_SOURCES += \ | |
215 | devpollmplexer.cc \ | |
216 | portsmplexer.cc | |
217 | endif | |
218 | ||
ca404e94 | 219 | testrunner_SOURCES = \ |
11e1e08b RG |
220 | base64.hh \ |
221 | dns.hh \ | |
e27e17c3 | 222 | test-base64_cc.cc \ |
94e4d723 | 223 | test-delaypipe_hh.cc \ |
47698274 | 224 | test-dnscrypt_cc.cc \ |
11e1e08b | 225 | test-dnsdist_cc.cc \ |
1d3ba133 | 226 | test-dnsdistdynblocks_hh.cc \ |
886e2cf2 | 227 | test-dnsdistpacketcache_cc.cc \ |
cfe4b655 | 228 | test-dnsdistrings_cc.cc \ |
05f4003d | 229 | test-dnsdistrules_cc.cc \ |
47698274 | 230 | test-dnsparser_cc.cc \ |
0047d734 | 231 | test-iputils_hh.cc \ |
05f4003d | 232 | cachecleaner.hh \ |
11e1e08b | 233 | dnsdist.hh \ |
886e2cf2 | 234 | dnsdist-cache.cc dnsdist-cache.hh \ |
ca404e94 | 235 | dnsdist-ecs.cc dnsdist-ecs.hh \ |
53c57da7 | 236 | dnsdist-xpf.cc dnsdist-xpf.hh \ |
11e1e08b | 237 | dnscrypt.cc dnscrypt.hh \ |
ca404e94 RG |
238 | dnslabeltext.cc \ |
239 | dnsname.cc dnsname.hh \ | |
240 | dnsparser.hh dnsparser.cc \ | |
241 | dnswriter.cc dnswriter.hh \ | |
242 | dolog.hh \ | |
5c3b5e7f | 243 | ednsoptions.cc ednsoptions.hh \ |
ff73f02b | 244 | ednscookies.cc ednscookies.hh \ |
ca404e94 | 245 | ednssubnet.cc ednssubnet.hh \ |
85c7ca75 | 246 | gettime.cc gettime.hh \ |
ca404e94 RG |
247 | iputils.cc iputils.hh \ |
248 | misc.cc misc.hh \ | |
249 | namespaces.hh \ | |
250 | pdnsexception.hh \ | |
251 | qtype.cc qtype.hh \ | |
252 | sholder.hh \ | |
e27e17c3 | 253 | sodcrypto.cc \ |
ca404e94 | 254 | sstuff.hh \ |
94e4d723 | 255 | threadname.hh threadname.cc \ |
5cc8371b RG |
256 | testrunner.cc \ |
257 | xpf.cc xpf.hh | |
ca404e94 RG |
258 | |
259 | testrunner_LDFLAGS = \ | |
260 | $(AM_LDFLAGS) \ | |
261 | $(PROGRAM_LDFLAGS) \ | |
262 | $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \ | |
263 | -pthread | |
264 | ||
265 | testrunner_LDADD = \ | |
266 | $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \ | |
11e1e08b | 267 | $(LIBSODIUM_LIBS) \ |
82a91ddf | 268 | $(FSTRM_LIBS) \ |
8d06661a | 269 | $(RT_LIBS) \ |
fdc3ea42 RG |
270 | $(SANITIZER_FLAGS) \ |
271 | $(LIBCAP_LIBS) | |
ca404e94 | 272 | |
f68a9074 PL |
273 | MANPAGES=dnsdist.1 |
274 | ||
275 | dist_man_MANS=$(MANPAGES) | |
276 | ||
20d81666 PL |
277 | if HAVE_VIRTUALENV |
278 | if !HAVE_MANPAGES | |
279 | $(MANPAGES): %: docs/manpages/%.rst .venv | |
280 | $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $< | |
281 | endif # if !HAVE_MANPAGES | |
282 | ||
283 | .venv: docs/requirements.txt | |
284 | virtualenv .venv | |
29455e8a | 285 | .venv/bin/pip install -U pip setuptools setuptools-git |
20d81666 PL |
286 | .venv/bin/pip install -r $< |
287 | ||
288 | latex/dnsdist.pdf: docs/** .venv | |
289 | .venv/bin/python -msphinx -M latexpdf docs . | |
290 | ||
291 | dnsdist.pdf: latex/dnsdist.pdf | |
292 | mv $< $@ | |
293 | ||
294 | html-docs.tar.bz2: html-docs | |
295 | tar cjf $@ $< | |
296 | ||
297 | html-docs: docs/** .venv | |
298 | .venv/bin/python -msphinx -b html docs html-docs | |
299 | ||
300 | all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf | |
301 | ||
302 | upload-docs: all-docs | |
60c95446 PL |
303 | rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org |
304 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org | |
305 | rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org | |
20d81666 PL |
306 | |
307 | else # if HAVE_VIRTUALENV | |
f68a9074 | 308 | $(MANPAGES): |
20d81666 PL |
309 | @echo "You need virtualenv to generate the manpages" |
310 | exit 1 | |
311 | ||
312 | html-docs: %: docs/manpages/%.rst .venv | |
313 | @echo "You need virtualenv to generate the HTML documentation" | |
314 | exit 1 | |
315 | ||
316 | dnsdist.pdf: | |
317 | @echo "You need virtualenv to generate the pdf documentation" | |
f68a9074 | 318 | exit 1 |
f68a9074 | 319 | endif |
6ab65223 PL |
320 | |
321 | if HAVE_SYSTEMD | |
322 | dnsdist.service: dnsdist.service.in | |
323 | $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@ | |
324 | ||
aa663221 PL |
325 | dnsdist@.service: dnsdist.service |
326 | $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@ | |
327 | ||
6ab65223 PL |
328 | systemdsystemunitdir = $(SYSTEMD_DIR) |
329 | ||
330 | systemdsystemunit_DATA = \ | |
aa663221 PL |
331 | dnsdist.service \ |
332 | dnsdist@.service | |
50169e30 CH |
333 | |
334 | CLEANFILES += \ | |
335 | dnsdist.service \ | |
336 | dnsdist@.service | |
6ab65223 | 337 | endif |
65613131 PL |
338 | |
339 | if !HAVE_LUA_HPP | |
340 | include lua_hpp.mk | |
341 | endif |