]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/dnsdistdist/Makefile.am
Merge pull request #7226 from rgacogne/oss-fuzz
[thirdparty/pdns.git] / pdns / dnsdistdist / Makefile.am
CommitLineData
82a91ddf 1AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFLAGS) $(FSTRM_CFLAGS) $(YAHTTP_CFLAGS) $(SANITIZER_FLAGS) $(NET_SNMP_CFLAGS) -DSYSCONFDIR=\"${sysconfdir}\"
50bed881 2
91487eb9
PL
3ACLOCAL_AMFLAGS = -I m4
4
f8204e9e 5SUBDIRS=ext/yahttp
bbfefc98 6
50169e30
CH
7CLEANFILES = \
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 15dnslabeltext.cc: dnslabeltext.rl
30bfe7f6 16 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
4676400a 17
56872c22
PL
18BUILT_SOURCES=htmlfiles.h \
19 dnslabeltext.cc
a1f81e3b 20
38b86118
PL
21htmlfiles.h: $(srcdir)/html/*
22 $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp
23 @mv $@.tmp $@
bbfefc98 24
7cc65f8a
SH
25SRC_JS_FILES := $(wildcard src_js/*.js)
26MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES))
27
28html/js/%.min.js: src_js/%.js
29 uglifyjs $< > $@
30
31min_js: $(MIN_JS_FILES)
32
4ed8dfeb 33if HAVE_RE2
34AM_CPPFLAGS += $(RE2_CFLAGS)
35endif
36
a227f47d
RG
37if HAVE_DNS_OVER_TLS
38if HAVE_LIBSSL
39AM_CPPFLAGS += $(LIBSSL_CFLAGS)
40endif
41
42if HAVE_GNUTLS
43AM_CPPFLAGS += $(GNUTLS_CFLAGS)
44endif
45endif
4ed8dfeb 46
190aaf91
PL
47EXTRA_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
71bin_PROGRAMS = dnsdist
d2143283
PL
72
73if UNIT_TESTS
74noinst_PROGRAMS = testrunner
3c2ea9e5
RG
75TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
76TESTS=testrunner
77else
78check-local:
79 @echo "Unit tests are not enabled"
80 @echo "Run ./configure --enable-unit-tests"
ca404e94
RG
81endif
82
ca9836cb
PL
83dnsdist-web.$(OBJEXT): htmlfiles.h
84
bbfefc98 85dnsdist_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
151dnsdist_LDFLAGS = \
152 $(AM_LDFLAGS) \
bfb7cc84 153 $(PROGRAM_LDFLAGS) \
50bed881 154 -pthread
bbfefc98 155
156dnsdist_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
RG
164 $(SYSTEMD_LIBS) \
165 $(NET_SNMP_LIBS)
bbfefc98 166
4ed8dfeb 167if HAVE_RE2
168dnsdist_LDADD += $(RE2_LIBS)
169endif
170
a227f47d
RG
171if HAVE_DNS_OVER_TLS
172if HAVE_GNUTLS
173dnsdist_LDADD += -lgnutls
174endif
175
176if HAVE_LIBSSL
177dnsdist_LDADD += $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
178endif
179endif
180
65613131
PL
181if !HAVE_LUA_HPP
182BUILT_SOURCES += lua.hpp
183nodist_dnsdist_SOURCES = lua.hpp
184CLEANFILES += lua.hpp
185endif
b2eccf5f 186
37a2da85
PL
187if HAVE_PROTOBUF
188if HAVE_PROTOC
b2eccf5f 189dnsmessage.pb.cc: dnsmessage.proto
38b86118 190 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
b2eccf5f 191
82a91ddf
CH
192dnstap.pb.cc: dnstap.proto
193 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
194
195BUILT_SOURCES += dnsmessage.pb.cc dnstap.pb.cc
37a2da85 196
82a91ddf 197nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h dnstap.pb.cc dnstap.pb.h
d8c19b98 198dnsdist_LDADD += $(PROTOBUF_LIBS)
37a2da85 199
82a91ddf 200dnsdist.$(OBJEXT): dnsmessage.pb.cc dnstap.pb.cc
37a2da85 201endif
d8c19b98 202endif
ca404e94 203
0e663c3b
RG
204if HAVE_FREEBSD
205dnsdist_SOURCES += kqueuemplexer.cc
206endif
207
208if HAVE_LINUX
209dnsdist_SOURCES += epollmplexer.cc
210endif
211
212if HAVE_SOLARIS
213dnsdist_SOURCES += \
214 devpollmplexer.cc \
215 portsmplexer.cc
216endif
217
ca404e94 218testrunner_SOURCES = \
11e1e08b
RG
219 base64.hh \
220 dns.hh \
e27e17c3 221 test-base64_cc.cc \
94e4d723 222 test-delaypipe_hh.cc \
47698274 223 test-dnscrypt_cc.cc \
11e1e08b 224 test-dnsdist_cc.cc \
1d3ba133 225 test-dnsdistdynblocks_hh.cc \
886e2cf2 226 test-dnsdistpacketcache_cc.cc \
cfe4b655 227 test-dnsdistrings_cc.cc \
05f4003d 228 test-dnsdistrules_cc.cc \
47698274 229 test-dnsparser_cc.cc \
0047d734 230 test-iputils_hh.cc \
05f4003d 231 cachecleaner.hh \
11e1e08b 232 dnsdist.hh \
886e2cf2 233 dnsdist-cache.cc dnsdist-cache.hh \
ca404e94 234 dnsdist-ecs.cc dnsdist-ecs.hh \
53c57da7 235 dnsdist-xpf.cc dnsdist-xpf.hh \
11e1e08b 236 dnscrypt.cc dnscrypt.hh \
ca404e94
RG
237 dnslabeltext.cc \
238 dnsname.cc dnsname.hh \
239 dnsparser.hh dnsparser.cc \
240 dnswriter.cc dnswriter.hh \
241 dolog.hh \
5c3b5e7f 242 ednsoptions.cc ednsoptions.hh \
ff73f02b 243 ednscookies.cc ednscookies.hh \
ca404e94 244 ednssubnet.cc ednssubnet.hh \
85c7ca75 245 gettime.cc gettime.hh \
ca404e94
RG
246 iputils.cc iputils.hh \
247 misc.cc misc.hh \
248 namespaces.hh \
249 pdnsexception.hh \
250 qtype.cc qtype.hh \
251 sholder.hh \
e27e17c3 252 sodcrypto.cc \
ca404e94 253 sstuff.hh \
94e4d723 254 threadname.hh threadname.cc \
5cc8371b
RG
255 testrunner.cc \
256 xpf.cc xpf.hh
ca404e94
RG
257
258testrunner_LDFLAGS = \
259 $(AM_LDFLAGS) \
260 $(PROGRAM_LDFLAGS) \
261 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
262 -pthread
263
264testrunner_LDADD = \
265 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
11e1e08b 266 $(LIBSODIUM_LIBS) \
82a91ddf 267 $(FSTRM_LIBS) \
8d06661a
RG
268 $(RT_LIBS) \
269 $(SANITIZER_FLAGS)
ca404e94 270
f68a9074
PL
271MANPAGES=dnsdist.1
272
273dist_man_MANS=$(MANPAGES)
274
20d81666
PL
275if HAVE_VIRTUALENV
276if !HAVE_MANPAGES
277$(MANPAGES): %: docs/manpages/%.rst .venv
278 $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $<
279endif # if !HAVE_MANPAGES
280
281.venv: docs/requirements.txt
282 virtualenv .venv
29455e8a 283 .venv/bin/pip install -U pip setuptools setuptools-git
20d81666
PL
284 .venv/bin/pip install -r $<
285
286latex/dnsdist.pdf: docs/** .venv
287 .venv/bin/python -msphinx -M latexpdf docs .
288
289dnsdist.pdf: latex/dnsdist.pdf
290 mv $< $@
291
292html-docs.tar.bz2: html-docs
293 tar cjf $@ $<
294
295html-docs: docs/** .venv
296 .venv/bin/python -msphinx -b html docs html-docs
297
298all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf
299
300upload-docs: all-docs
60c95446
PL
301 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org
302 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org
303 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org
20d81666
PL
304
305else # if HAVE_VIRTUALENV
f68a9074 306$(MANPAGES):
20d81666
PL
307 @echo "You need virtualenv to generate the manpages"
308 exit 1
309
310html-docs: %: docs/manpages/%.rst .venv
311 @echo "You need virtualenv to generate the HTML documentation"
312 exit 1
313
314dnsdist.pdf:
315 @echo "You need virtualenv to generate the pdf documentation"
f68a9074 316 exit 1
f68a9074 317endif
6ab65223
PL
318
319if HAVE_SYSTEMD
320dnsdist.service: dnsdist.service.in
321 $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@
322
aa663221
PL
323dnsdist@.service: dnsdist.service
324 $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' < $< >$@
325
6ab65223
PL
326systemdsystemunitdir = $(SYSTEMD_DIR)
327
328systemdsystemunit_DATA = \
aa663221
PL
329 dnsdist.service \
330 dnsdist@.service
50169e30
CH
331
332CLEANFILES += \
333 dnsdist.service \
334 dnsdist@.service
6ab65223 335endif
65613131
PL
336
337if !HAVE_LUA_HPP
338include lua_hpp.mk
339endif