]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/dnsdistdist/Makefile.am
Add rst-based dnsdist documentation.
[thirdparty/pdns.git] / pdns / dnsdistdist / Makefile.am
CommitLineData
9f4eb5cc 1AM_CPPFLAGS += $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) $(LIBEDIT_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
38b86118 7CLEANFILES = dnsmessage.pb.cc dnsmessage.pb.h htmlfiles.h.tmp htmlfiles.h
37a2da85 8
bbfefc98 9dnslabeltext.cc: dnslabeltext.rl
30bfe7f6 10 $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
4676400a 11
56872c22
PL
12BUILT_SOURCES=htmlfiles.h \
13 dnslabeltext.cc
a1f81e3b 14
38b86118
PL
15htmlfiles.h: $(srcdir)/html/*
16 $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp
17 @mv $@.tmp $@
bbfefc98 18
7cc65f8a
SH
19SRC_JS_FILES := $(wildcard src_js/*.js)
20MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES))
21
22html/js/%.min.js: src_js/%.js
23 uglifyjs $< > $@
24
25min_js: $(MIN_JS_FILES)
26
4ed8dfeb 27if HAVE_RE2
28AM_CPPFLAGS += $(RE2_CFLAGS)
29endif
30
31
994c0ab3
PL
32EXTRA_DIST=dnslabeltext.rl \
33 dnsdistconf.lua \
59c83cf6 34 dnsmessage.proto \
994c0ab3 35 README.md \
25553371 36 delaypipe.cc delaypipe.hh \
994c0ab3 37 html \
5242cc51 38 .version \
b3bcfb63 39 contrib \
1caf101b 40 build-aux/gen-version \
babc4bab
SH
41 ext/incbin/UNLICENSE \
42 incfiles \
6ab65223 43 src_js \
65613131 44 dnsdist.service.in \
d45189b7
RG
45 lua_hpp.mk \
46 bpf-filter.main.ebpf \
47 bpf-filter.qname.ebpf \
9f4eb5cc
RG
48 bpf-filter.ebpf.src \
49 DNSDIST-MIB.txt
bbfefc98 50
51bin_PROGRAMS = dnsdist
d2143283
PL
52
53if UNIT_TESTS
54noinst_PROGRAMS = testrunner
3c2ea9e5
RG
55TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
56TESTS=testrunner
57else
58check-local:
59 @echo "Unit tests are not enabled"
60 @echo "Run ./configure --enable-unit-tests"
ca404e94
RG
61endif
62
ca9836cb
PL
63dnsdist-web.$(OBJEXT): htmlfiles.h
64
bbfefc98 65dnsdist_SOURCES = \
6ee9a5a2 66 ascii.hh \
1489accc 67 base64.hh \
87b515ed 68 bpf-filter.cc bpf-filter.hh \
77f8ae1a 69 dns.cc dns.hh \
11e1e08b 70 dnscrypt.cc dnscrypt.hh \
bbfefc98 71 dnsdist.cc dnsdist.hh \
87b515ed 72 dnsdist-dynbpf.cc dnsdist-dynbpf.hh \
886e2cf2 73 dnsdist-cache.cc dnsdist-cache.hh \
96b092a7 74 dnsdist-carbon.cc \
ffb07158 75 dnsdist-console.cc \
11e1e08b 76 dnsdist-dnscrypt.cc \
ca404e94 77 dnsdist-ecs.cc dnsdist-ecs.hh \
cf48b0ce 78 dnsdist-lua.hh dnsdist-lua.cc \
80a216c9 79 dnsdist-lua2.cc \
ec469dd7 80 dnsdist-protobuf.cc dnsdist-protobuf.hh \
f092a5c7 81 dnsdist-rings.cc \
9f4eb5cc 82 dnsdist-snmp.cc dnsdist-snmp.hh \
8a5d5053 83 dnsdist-tcp.cc \
50bed881 84 dnsdist-web.cc \
bbfefc98 85 dnslabeltext.cc \
86 dnsname.cc dnsname.hh \
ca404e94 87 dnsparser.hh dnsparser.cc \
cf6874ba 88 dnsrulactions.cc dnsrulactions.hh \
bbfefc98 89 dnswriter.cc dnswriter.hh \
90 dolog.hh \
5c3b5e7f 91 ednsoptions.cc ednsoptions.hh \
ff73f02b 92 ednscookies.cc ednscookies.hh \
ca404e94 93 ednssubnet.cc ednssubnet.hh \
85c7ca75 94 gettime.cc gettime.hh \
bbfefc98 95 iputils.cc iputils.hh \
0e41337b 96 lock.hh \
bbfefc98 97 misc.cc misc.hh \
ed1f29ef 98 htmlfiles.h \
bbfefc98 99 namespaces.hh \
100 pdnsexception.hh \
d9d3f9c1 101 protobuf.cc protobuf.hh \
bbfefc98 102 qtype.cc qtype.hh \
ec469dd7 103 remote_logger.cc remote_logger.hh \
ecbe9133 104 sholder.hh \
9f4eb5cc 105 snmp-agent.cc snmp-agent.hh \
bbfefc98 106 sodcrypto.cc sodcrypto.hh \
f8204e9e 107 sstuff.hh \
71c94675 108 statnode.cc statnode.hh \
f8204e9e
PL
109 ext/luawrapper/include/LuaContext.hpp \
110 ext/json11/json11.cpp \
111 ext/json11/json11.hpp \
87b515ed
RG
112 ext/incbin/incbin.h \
113 ext/libbpf/libbpf.h
bbfefc98 114
115dnsdist_LDFLAGS = \
116 $(AM_LDFLAGS) \
bfb7cc84 117 $(PROGRAM_LDFLAGS) \
50bed881 118 -pthread
bbfefc98 119
120dnsdist_LDADD = \
a6158e7a 121 $(LUA_LIBS) \
d9de8b61 122 $(LIBEDIT_LIBS) \
a6158e7a
RK
123 $(RT_LIBS) \
124 $(YAHTTP_LIBS) \
e85e4d88 125 $(LIBSODIUM_LIBS) \
6ab65223 126 $(SANITIZER_FLAGS) \
9f4eb5cc
RG
127 $(SYSTEMD_LIBS) \
128 $(NET_SNMP_LIBS)
bbfefc98 129
4ed8dfeb 130if HAVE_RE2
131dnsdist_LDADD += $(RE2_LIBS)
132endif
133
65613131
PL
134if !HAVE_LUA_HPP
135BUILT_SOURCES += lua.hpp
136nodist_dnsdist_SOURCES = lua.hpp
137CLEANFILES += lua.hpp
138endif
b2eccf5f 139
37a2da85
PL
140if HAVE_PROTOBUF
141if HAVE_PROTOC
b2eccf5f 142dnsmessage.pb.cc: dnsmessage.proto
38b86118 143 $(AM_V_GEN)$(PROTOC) -I$(srcdir) --cpp_out=./ $<
b2eccf5f 144
b2eccf5f 145BUILT_SOURCES += dnsmessage.pb.cc
37a2da85
PL
146
147nodist_dnsdist_SOURCES = dnsmessage.pb.cc dnsmessage.pb.h
d8c19b98 148dnsdist_LDADD += $(PROTOBUF_LIBS)
37a2da85
PL
149
150dnsdist.$(OBJEXT): dnsmessage.pb.cc
151endif
d8c19b98 152endif
ca404e94
RG
153
154testrunner_SOURCES = \
11e1e08b
RG
155 base64.hh \
156 dns.hh \
e27e17c3 157 test-base64_cc.cc \
11e1e08b 158 test-dnsdist_cc.cc \
886e2cf2 159 test-dnsdistpacketcache_cc.cc \
11e1e08b
RG
160 test-dnscrypt_cc.cc \
161 dnsdist.hh \
886e2cf2 162 dnsdist-cache.cc dnsdist-cache.hh \
ca404e94 163 dnsdist-ecs.cc dnsdist-ecs.hh \
11e1e08b 164 dnscrypt.cc dnscrypt.hh \
ca404e94
RG
165 dnslabeltext.cc \
166 dnsname.cc dnsname.hh \
167 dnsparser.hh dnsparser.cc \
168 dnswriter.cc dnswriter.hh \
169 dolog.hh \
5c3b5e7f 170 ednsoptions.cc ednsoptions.hh \
ff73f02b 171 ednscookies.cc ednscookies.hh \
ca404e94 172 ednssubnet.cc ednssubnet.hh \
85c7ca75 173 gettime.cc gettime.hh \
ca404e94
RG
174 iputils.cc iputils.hh \
175 misc.cc misc.hh \
176 namespaces.hh \
177 pdnsexception.hh \
178 qtype.cc qtype.hh \
179 sholder.hh \
e27e17c3 180 sodcrypto.cc \
ca404e94
RG
181 sstuff.hh \
182 testrunner.cc
183
184testrunner_LDFLAGS = \
185 $(AM_LDFLAGS) \
186 $(PROGRAM_LDFLAGS) \
187 $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
188 -pthread
189
190testrunner_LDADD = \
191 $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
11e1e08b 192 $(LIBSODIUM_LIBS) \
8d06661a
RG
193 $(RT_LIBS) \
194 $(SANITIZER_FLAGS)
ca404e94 195
f68a9074
PL
196MANPAGES=dnsdist.1
197
198dist_man_MANS=$(MANPAGES)
199
20d81666
PL
200if HAVE_VIRTUALENV
201if !HAVE_MANPAGES
202$(MANPAGES): %: docs/manpages/%.rst .venv
203 $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $<
204endif # if !HAVE_MANPAGES
205
206.venv: docs/requirements.txt
207 virtualenv .venv
208 .venv/bin/pip install -r $<
209
210latex/dnsdist.pdf: docs/** .venv
211 .venv/bin/python -msphinx -M latexpdf docs .
212
213dnsdist.pdf: latex/dnsdist.pdf
214 mv $< $@
215
216html-docs.tar.bz2: html-docs
217 tar cjf $@ $<
218
219html-docs: docs/** .venv
220 .venv/bin/python -msphinx -b html docs html-docs
221
222all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf
223
224upload-docs: all-docs
225 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org/new
226 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org/new
227 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org/new
228
229else # if HAVE_VIRTUALENV
f68a9074 230$(MANPAGES):
20d81666
PL
231 @echo "You need virtualenv to generate the manpages"
232 exit 1
233
234html-docs: %: docs/manpages/%.rst .venv
235 @echo "You need virtualenv to generate the HTML documentation"
236 exit 1
237
238dnsdist.pdf:
239 @echo "You need virtualenv to generate the pdf documentation"
f68a9074 240 exit 1
f68a9074 241endif
6ab65223
PL
242
243if HAVE_SYSTEMD
244dnsdist.service: dnsdist.service.in
245 $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' < $< > $@
246
247systemdsystemunitdir = $(SYSTEMD_DIR)
248
249systemdsystemunit_DATA = \
250 dnsdist.service
251endif
65613131
PL
252
253if !HAVE_LUA_HPP
254include lua_hpp.mk
255endif