Skip to content
Snippets Groups Projects
Forked from Knot projects / Knot DNS
7285 commits behind the upstream repository.
Makefile.am 12.94 KiB
ACLOCAL_AMFLAGS = -I $(top_srcdir)/m4
SUBDIRS = zscanner dnssec contrib/dnstap .

.PHONY: check-compile
check-compile:
	$(MAKE) $(AM_MAKEFLAGS) -C zscanner $@
	$(MAKE) $(AM_MAKEFLAGS) -C dnssec $@

lib_LTLIBRARIES =				\
	libknot.la
noinst_LTLIBRARIES = 				\
	libcontrib.la				\
	libknot-yparser.la

AM_CPPFLAGS = \
	-include $(top_builddir)/src/config.h	\
	-DCONFIG_DIR='"${config_dir}"'		\
	-DSTORAGE_DIR='"${storage_dir}"'	\
	-DRUN_DIR='"${run_dir}"'		\
	-I$(srcdir)/dnssec/lib

######################
# Knot DNS Libraries #
######################

EXTRA_DIST =					\
	contrib/licenses/0BSD			\
	contrib/licenses/LGPL-2.0		\
	contrib/licenses/MIT			\
	contrib/licenses/OLDAP-2.8		\
	contrib/hat-trie/LICENSE		\
	contrib/lmdb/LICENSE			\
	contrib/murmurhash3/LICENSE		\
	contrib/openbsd/LICENSE			\
	contrib/ucw/LICENSE

# static: libcontrib sources
libcontrib_la_SOURCES = 			\
	contrib/asan.h				\
	contrib/base32hex.c			\
	contrib/base32hex.h			\
	contrib/base64.c			\
	contrib/base64.h			\
	contrib/endian.h			\
	contrib/files.c				\
	contrib/files.h				\
	contrib/getline.c			\
	contrib/getline.h			\
	contrib/hhash.c				\
	contrib/hhash.h				\
	contrib/macros.h			\
	contrib/mempattern.c			\
	contrib/mempattern.h			\
	contrib/net.c				\
	contrib/net.h				\
	contrib/print.c				\
	contrib/print.h				\
	contrib/sockaddr.c			\
	contrib/sockaddr.h			\
	contrib/string.c			\
	contrib/string.h			\
	contrib/time.h				\
	contrib/tolower.h			\
	contrib/trim.h				\
	contrib/wire.h				\
	contrib/wire_ctx.h			\
	contrib/hat-trie/hat-trie.c		\
	contrib/hat-trie/hat-trie.h		\
	contrib/murmurhash3/murmurhash3.c	\
	contrib/murmurhash3/murmurhash3.h	\
	contrib/openbsd/strlcat.c		\
	contrib/openbsd/strlcat.h		\
	contrib/openbsd/strlcpy.c		\
	contrib/openbsd/strlcpy.h		\
	contrib/ucw/array-sort.h		\
	contrib/ucw/binsearch.h			\
	contrib/ucw/heap.c			\
	contrib/ucw/heap.h			\
	contrib/ucw/lists.c			\
	contrib/ucw/lists.h			\
	contrib/ucw/mempool.c			\
	contrib/ucw/mempool.h

# static: libknot-yparser sources
libknot_yparser_la_SOURCES = 			\
	libknot/yparser/yparser.c		\
	libknot/yparser/yparser.h		\
	libknot/yparser/ypbody.c		\
	libknot/yparser/ypformat.c		\
	libknot/yparser/ypformat.h		\
	libknot/yparser/ypscheme.c		\
	libknot/yparser/ypscheme.h		\
	libknot/yparser/yptrafo.c		\
	libknot/yparser/yptrafo.h

# libknot headers
libknot_ladir = $(includedir)
nobase_libknot_la_HEADERS =			\
	libknot/attribute.h			\
	libknot/binary.h			\
	libknot/codes.h				\
	libknot/consts.h			\
	libknot/control/control.h		\
	libknot/descriptor.h			\
	libknot/dname.h				\
	libknot/errcode.h			\
	libknot/error.h				\
	libknot/libknot.h			\
	libknot/lookup.h			\
	libknot/mm_ctx.h			\
	libknot/db/db.h				\
	libknot/db/db_lmdb.h			\
	libknot/db/db_trie.h			\
	libknot/packet/compr.h			\
	libknot/packet/pkt.h			\
	libknot/packet/rrset-wire.h		\
	libknot/packet/wire.h			\
	libknot/rdata.h				\
	libknot/rdataset.h			\
	libknot/rrset-dump.h			\
	libknot/rrset.h				\
	libknot/rrtype/aaaa.h			\
	libknot/rrtype/dnskey.h			\
	libknot/rrtype/ds.h			\
	libknot/rrtype/naptr.h			\
	libknot/rrtype/nsec.h			\
	libknot/rrtype/nsec3.h			\
	libknot/rrtype/nsec3param.h		\
	libknot/rrtype/opt.h			\
	libknot/rrtype/rdname.h			\
	libknot/rrtype/rrsig.h			\
	libknot/rrtype/soa.h			\
	libknot/rrtype/tsig.h			\
	libknot/rrtype/txt.h			\
	libknot/tsig-op.h			\
	libknot/tsig.h				\
	libknot/version.h

# dynamic: libknot sources
libknot_la_SOURCES =				\
	libknot/binary.c			\
	libknot/codes.c				\
	libknot/control/control.c		\
	libknot/descriptor.c			\
	libknot/dname.c				\
	libknot/error.c				\
	libknot/db/db_lmdb.c			\
	libknot/db/db_trie.c			\
	libknot/packet/compr.c			\
	libknot/packet/pkt.c			\
	libknot/packet/rrset-wire.c		\
	libknot/packet/wire.c			\
	libknot/rdata.c				\
	libknot/rdataset.c			\
	libknot/rrset-dump.c			\
	libknot/rrset.c				\
	libknot/rrtype/aaaa.c			\
	libknot/rrtype/dnskey.c			\
	libknot/rrtype/ds.c			\
	libknot/rrtype/naptr.c			\
	libknot/rrtype/nsec3.c			\
	libknot/rrtype/nsec3param.c		\
	libknot/rrtype/opt.c			\
	libknot/rrtype/rrsig.c			\
	libknot/rrtype/soa.c			\
	libknot/rrtype/tsig.c			\
	libknot/tsig-op.c			\
	libknot/tsig.c				\
	$(nobase_libknot_la_HEADERS)

libknot_la_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAG_VISIBILITY) $(lmdb_CFLAGS)
libknot_la_CFLAGS = $(AM_CFLAGS)
libknot_la_LDFLAGS = $(AM_LDFLAGS) $(libknot_VERSION_INFO) $(lmdb_LIBS)
libknot_la_LIBADD = dnssec/libdnssec.la libcontrib.la

# pkg-config
pkgconfig_DATA = libknot.pc

if !HAVE_LMDB
libknot_la_SOURCES +=				\
	contrib/lmdb/lmdb.h			\
	contrib/lmdb/mdb.c			\
	contrib/lmdb/midl.c			\
	contrib/lmdb/midl.h
libknot_la_CPPFLAGS +=				\
	-I$(srcdir)/contrib/lmdb/
endif

# static: utilities shared
libknotus_la_SOURCES =				\
	utils/common/exec.c			\
	utils/common/exec.h			\
	utils/common/hex.c			\
	utils/common/hex.h			\
	utils/common/lookup.c			\
	utils/common/lookup.h			\
	utils/common/msg.c			\
	utils/common/msg.h			\
	utils/common/netio.c			\
	utils/common/netio.h			\
	utils/common/params.c			\
	utils/common/params.h			\
	utils/common/resolv.c			\
	utils/common/resolv.h			\
	utils/common/sign.c			\
	utils/common/sign.h			\
	utils/common/strtonum.h			\
	utils/common/token.c			\
	utils/common/token.h
libknotus_la_CPPFLAGS = $(AM_CPPFLAGS) $(libidn_CFLAGS) $(libedit_CFLAGS)
libknotus_la_LDFLAGS = $(AM_LDFLAGS) $(libidn_LIBS)
libknotus_la_LIBADD = libcontrib.la libknot.la

###################
# Knot DNS Daemon #
###################

if HAVE_DAEMON

sbin_PROGRAMS = knotc knotd kzonecheck
libexec_PROGRAMS = knot1to2
noinst_LTLIBRARIES += libknotd.la libknotus.la

EXTRA_DIST += 					\
	utils/knot1to2/cf-lex.l			\
	utils/knot1to2/cf-parse.y

knotc_SOURCES =					\
	utils/knotc/commands.c			\
	utils/knotc/commands.h			\
	utils/knotc/estimator.c			\
	utils/knotc/estimator.h			\
	utils/knotc/interactive.c		\
	utils/knotc/interactive.h		\
	utils/knotc/process.c			\
	utils/knotc/process.h			\
	utils/knotc/main.c

knotd_SOURCES =					\
	utils/knotd/main.c

knot1to2_SOURCES =				\
	utils/knot1to2/cf-lex.c			\
	utils/knot1to2/cf-parse.tab.c		\
	utils/knot1to2/cf-parse.tab.h		\
	utils/knot1to2/extra.c			\
	utils/knot1to2/extra.h			\
	utils/knot1to2/includes.c		\
	utils/knot1to2/includes.h		\
	utils/knot1to2/main.c			\
	utils/knot1to2/scheme.h

# static: server shared
libknotd_la_SOURCES =				\
	knot/conf/base.c			\
	knot/conf/base.h			\
	knot/conf/conf.c			\
	knot/conf/conf.h			\
	knot/conf/confdb.c			\
	knot/conf/confdb.h			\
	knot/conf/confio.c			\
	knot/conf/confio.h			\
	knot/conf/scheme.c			\
	knot/conf/scheme.h			\
	knot/conf/tools.c			\
	knot/conf/tools.h			\
	knot/ctl/commands.c			\
	knot/ctl/commands.h			\
	knot/ctl/process.c			\
	knot/ctl/process.h			\
	knot/dnssec/context.c			\
	knot/dnssec/context.h			\
	knot/dnssec/nsec-chain.c		\
	knot/dnssec/nsec-chain.h		\
	knot/dnssec/nsec3-chain.c		\
	knot/dnssec/nsec3-chain.h		\
	knot/dnssec/policy.c			\
	knot/dnssec/policy.h			\
	knot/dnssec/rrset-sign.c		\
	knot/dnssec/rrset-sign.h		\
	knot/dnssec/zone-events.c		\
	knot/dnssec/zone-events.h		\
	knot/dnssec/zone-keys.c			\
	knot/dnssec/zone-keys.h			\
	knot/dnssec/zone-nsec.c			\
	knot/dnssec/zone-nsec.h			\
	knot/dnssec/zone-sign.c			\
	knot/dnssec/zone-sign.h			\
	knot/events/events.c			\
	knot/events/events.h			\
	knot/events/handlers.h			\
	knot/events/handlers/dnssec.c		\
	knot/events/handlers/expire.c		\
	knot/events/handlers/flush.c		\
	knot/events/handlers/load.c		\
	knot/events/handlers/notify.c		\
	knot/events/handlers/refresh.c		\
	knot/events/handlers/update.c		\
	knot/events/replan.c			\
	knot/events/replan.h			\
	knot/modules/dnsproxy.c			\
	knot/modules/dnsproxy.h			\
	knot/modules/online_sign/module.c	\
	knot/modules/online_sign/module.h	\
	knot/modules/online_sign/nsec_next.c	\
	knot/modules/online_sign/nsec_next.h	\
	knot/modules/synth_record.c		\
	knot/modules/synth_record.h		\
	knot/nameserver/axfr.c			\
	knot/nameserver/axfr.h			\
	knot/nameserver/chaos.c			\
	knot/nameserver/chaos.h			\
	knot/nameserver/internet.c		\
	knot/nameserver/internet.h		\
	knot/nameserver/ixfr.c			\
	knot/nameserver/ixfr.h			\
	knot/nameserver/log.h			\
	knot/nameserver/notify.c		\
	knot/nameserver/notify.h		\
	knot/nameserver/nsec_proofs.c		\
	knot/nameserver/nsec_proofs.h		\
	knot/nameserver/process_query.c		\
	knot/nameserver/process_query.h		\
	knot/nameserver/query_module.c		\
	knot/nameserver/query_module.h		\
	knot/nameserver/tsig_ctx.c		\
	knot/nameserver/tsig_ctx.h		\
	knot/nameserver/update.c		\
	knot/nameserver/update.h		\
	knot/query/capture.c			\
	knot/query/capture.h			\
	knot/query/layer.c			\
	knot/query/layer.h			\
	knot/query/overlay.c			\
	knot/query/overlay.h			\
	knot/query/query.c			\
	knot/query/query.h			\
	knot/query/requestor.c			\
	knot/query/requestor.h			\
	knot/common/evsched.c			\
	knot/common/evsched.h			\
	knot/common/fdset.c			\
	knot/common/fdset.h			\
	knot/common/log.c			\
	knot/common/log.h			\
	knot/common/process.c			\
	knot/common/process.h			\
	knot/common/ref.c			\
	knot/common/ref.h			\
	knot/server/dthreads.c			\
	knot/server/dthreads.h			\
	knot/server/journal.c			\
	knot/server/journal.h			\
	knot/server/rrl.c			\
	knot/server/rrl.h			\
	knot/server/serialization.c		\
	knot/server/serialization.h		\
	knot/server/server.c			\
	knot/server/server.h			\
	knot/server/tcp-handler.c		\
	knot/server/tcp-handler.h		\
	knot/server/udp-handler.c		\
	knot/server/udp-handler.h		\
	knot/updates/acl.c			\
	knot/updates/acl.h			\
	knot/updates/apply.c			\
	knot/updates/apply.h			\
	knot/updates/changesets.c		\
	knot/updates/changesets.h		\
	knot/updates/ddns.c			\
	knot/updates/ddns.h			\
	knot/updates/zone-update.c		\
	knot/updates/zone-update.h		\
	knot/worker/pool.c			\
	knot/worker/pool.h			\
	knot/worker/queue.c			\
	knot/worker/queue.h			\
	knot/zone/contents.c			\
	knot/zone/contents.h			\
	knot/zone/node.c			\
	knot/zone/node.h			\
	knot/zone/semantic-check.c		\
	knot/zone/semantic-check.h		\
	knot/zone/serial.c			\
	knot/zone/serial.h			\
	knot/zone/timers.c			\
	knot/zone/timers.h			\
	knot/zone/zone-diff.c			\
	knot/zone/zone-diff.h			\
	knot/zone/zone-dump.c			\
	knot/zone/zone-dump.h			\
	knot/zone/zone-load.c			\
	knot/zone/zone-load.h			\
	knot/zone/zone-tree.c			\
	knot/zone/zone-tree.h			\
	knot/zone/zone.c			\
	knot/zone/zone.h			\
	knot/zone/zonedb-load.c			\
	knot/zone/zonedb-load.h			\
	knot/zone/zonedb.c			\
	knot/zone/zonedb.h			\
	knot/zone/zonefile.c			\
	knot/zone/zonefile.h

libknotd_la_CPPFLAGS  = $(AM_CPPFLAGS) $(systemd_CFLAGS) $(liburcu_CFLAGS)
libknotd_la_LDFLAGS = $(AM_LDFLAGS) $(systemd_LIBS) $(liburcu_LIBS)
libknotd_la_LIBADD = libknot.la libknot-yparser.la zscanner/libzscanner.la $(liburcu_LIBS)

knotd_CPPFLAGS = $(AM_CPPFLAGS) $(liburcu_CFLAGS)
knotd_LDADD = libknotd.la $(liburcu_LIBS)
knotc_CPPFLAGS = $(AM_CPPFLAGS) $(libedit_CFLAGS)
knotc_LDADD = libknotd.la libknotus.la $(libedit_LIBS)
knot1to2_LDADD = libcontrib.la

kzonecheck_SOURCES = \
	utils/kzonecheck/main.c \
	utils/kzonecheck/zone_check.c \
	utils/kzonecheck/zone_check.h
kzonecheck_LDADD = libknotd.la

####################################
# Optional Knot DNS Daemon modules #
####################################

if HAVE_DNSTAP
libknotd_la_SOURCES +=				\
	knot/modules/dnstap.c			\
	knot/modules/dnstap.h
libknotd_la_CPPFLAGS += $(DNSTAP_CFLAGS)
libknotd_la_LIBADD += $(DNSTAP_LIBS) contrib/dnstap/libdnstap.la
endif # HAVE_DNSTAP

if HAVE_ROSEDB
libknotd_la_SOURCES +=				\
	knot/modules/rosedb.c			\
	knot/modules/rosedb.h
endif # HAVE_ROSEDB

# Create storage and run-time directories
install-data-hook:
	$(INSTALL) -d $(DESTDIR)/@config_dir@
	$(INSTALL) -d $(DESTDIR)/@run_dir@
	$(INSTALL) -d $(DESTDIR)/@storage_dir@

endif # HAVE_DAEMON

######################
# Knot DNS Utilities #
######################

if HAVE_UTILS

bin_PROGRAMS = kdig khost knsupdate
noinst_LTLIBRARIES += libknotus.la

kdig_SOURCES =					\
	utils/kdig/kdig_exec.c			\
	utils/kdig/kdig_exec.h			\
	utils/kdig/kdig_main.c			\
	utils/kdig/kdig_params.c		\
	utils/kdig/kdig_params.h

khost_SOURCES =					\
	utils/kdig/kdig_exec.c			\
	utils/kdig/kdig_exec.h			\
	utils/kdig/kdig_params.c		\
	utils/kdig/kdig_params.h		\
	utils/khost/khost_main.c		\
	utils/khost/khost_params.c		\
	utils/khost/khost_params.h

knsupdate_SOURCES =				\
	utils/knsupdate/knsupdate_exec.c	\
	utils/knsupdate/knsupdate_exec.h	\
	utils/knsupdate/knsupdate_main.c	\
	utils/knsupdate/knsupdate_params.c	\
	utils/knsupdate/knsupdate_params.h

# bin programs
kdig_LDADD       = $(libidn_LIBS) libknotus.la
khost_LDADD      = $(libidn_LIBS) libknotus.la
knsupdate_LDADD  = zscanner/libzscanner.la libknotus.la

#######################################
# Optional Knot DNS Utilities modules #
#######################################

if HAVE_DNSTAP
kdig_LDADD         += $(DNSTAP_LIBS) contrib/dnstap/libdnstap.la
khost_LDADD        += $(DNSTAP_LIBS) contrib/dnstap/libdnstap.la
kdig_CFLAGS = $(AM_CFLAGS) $(DNSTAP_CFLAGS)
khost_CFLAGS = $(AM_CFLAGS) $(DNSTAP_CFLAGS)
endif # HAVE_DNSTAP

if HAVE_ROSEDB
bin_PROGRAMS += rosedb_tool
rosedb_tool_SOURCES = knot/modules/rosedb_tool.c
rosedb_tool_LDADD = libknotd.la
rosedb_tool_CFLAGS = $(AM_CFLAGS) $(lmdb_CFLAGS) $(DNSTAP_CFLAGS)
rosedb_tool_LDFLAGS = $(AM_LDFLAGS) $(lmdb_LIBS)
endif # HAVE_ROSEDB

endif # HAVE_UTILS