Makefile.am 7.37 KB
Newer Older
1 2
AUTOMAKE_OPTIONS = subdir-objects

3
SUBDIRS = . testutils tests
4

5
dhcp_data_dir = @localstatedir@/@PACKAGE@
6
kea_lfc_location = @prefix@/sbin/kea-lfc
7 8

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib -DDHCP_DATA_DIR="\"$(dhcp_data_dir)\""
9
AM_CPPFLAGS += -DTOP_BUILDDIR="\"$(top_builddir)\""
10 11
# Set location of the kea-lfc binary.
AM_CPPFLAGS += -DKEA_LFC_EXECUTABLE="\"$(kea_lfc_location)\""
12 13 14 15
AM_CPPFLAGS += $(BOOST_INCLUDES)
if HAVE_MYSQL
AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
endif
16 17 18
if HAVE_PGSQL
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
endif
19

20
AM_CXXFLAGS = $(KEA_CXXFLAGS)
21

22 23 24 25 26 27 28
# The files in the subfolder must be explicitly specified here so
# as they are copied to the distribution. The other option would
# be to specify a whole 'parsers' folder here but that would also
# copy all other files, e.g. gitignore, .git etc.
# Whenever new file is added to the parsers folder, it must be
# added here.
EXTRA_DIST =
29 30 31 32 33 34 35
EXTRA_DIST += parsers/dbaccess_parser.cc
EXTRA_DIST += parsers/dbaccess_parser.h
EXTRA_DIST += parsers/dhcp_parsers.cc
EXTRA_DIST += parsers/dhcp_parsers.h
EXTRA_DIST += parsers/host_reservation_parser.cc
EXTRA_DIST += parsers/host_reservation_parser.h
EXTRA_DIST += parsers/host_reservations_list_parser.h
36

37
# Define rule to build logging source files from message file
38
dhcpsrv_messages.h dhcpsrv_messages.cc hosts_messages.h hosts_messages.cc: s-messages
39

40
s-messages: dhcpsrv_messages.mes hosts_messages.mes
41
	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/dhcpsrv/dhcpsrv_messages.mes
42
	touch $@
43 44
	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/dhcpsrv/hosts_messages.mes
	touch $@
45

46 47 48 49
# Tell Automake that the {dhcpsrv,hosts}_messages.{cc,h} source files are created
# in the build process, so it must create these before doing anything else.
# Although they are a dependency of the library (so will be created from the message
# file anyway), there is no guarantee as to exactly _when_ in the build they will be
50 51 52
# created.  As the .h file is included in other sources file (so must be
# present when they are compiled), the safest option is to create it first.
BUILT_SOURCES = dhcpsrv_messages.h dhcpsrv_messages.cc
53
BUILT_SOURCES += hosts_messages.h hosts_messages.cc
54

55 56 57 58 59 60
# Some versions of GCC warn about some versions of Boost regarding
# missing initializer for members in its posix_time.
# https://svn.boost.org/trac/boost/ticket/3477
# But older GCC compilers don't have the flag.
AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)

61
# Make sure the generated files are deleted in a "clean" operation
62 63
CLEANFILES = *.gcno *.gcda dhcpsrv_messages.h dhcpsrv_messages.cc
CLEANFILES += hosts_messages.h hosts_messages.cc s-messages
64 65
# Remove CSV files created by the CSVLeaseFile6 and CSVLeaseFile4 unit tests.
CLEANFILES += *.csv
66

67 68 69 70
lib_LTLIBRARIES = libkea-dhcpsrv.la
libkea_dhcpsrv_la_SOURCES  =
libkea_dhcpsrv_la_SOURCES += addr_utilities.cc addr_utilities.h
libkea_dhcpsrv_la_SOURCES += alloc_engine.cc alloc_engine.h
71
libkea_dhcpsrv_la_SOURCES += base_host_data_source.h
72
libkea_dhcpsrv_la_SOURCES += callout_handle_store.h
73
libkea_dhcpsrv_la_SOURCES += cfg_hosts.cc cfg_hosts.h
74
libkea_dhcpsrv_la_SOURCES += cfg_iface.cc cfg_iface.h
75
libkea_dhcpsrv_la_SOURCES += cfg_option.cc cfg_option.h
76
libkea_dhcpsrv_la_SOURCES += cfg_option_def.cc cfg_option_def.h
77
libkea_dhcpsrv_la_SOURCES += cfg_rsoo.cc cfg_rsoo.h
78
libkea_dhcpsrv_la_SOURCES += cfg_subnets4.cc cfg_subnets4.h
79
libkea_dhcpsrv_la_SOURCES += cfg_subnets6.cc cfg_subnets6.h
Tomek Mrugalski's avatar
Tomek Mrugalski committed
80
libkea_dhcpsrv_la_SOURCES += cfg_mac_source.cc cfg_mac_source.h
81
libkea_dhcpsrv_la_SOURCES += cfgmgr.cc cfgmgr.h
82 83 84 85
libkea_dhcpsrv_la_SOURCES += csv_lease_file4.cc csv_lease_file4.h
libkea_dhcpsrv_la_SOURCES += csv_lease_file6.cc csv_lease_file6.h
libkea_dhcpsrv_la_SOURCES += d2_client_cfg.cc d2_client_cfg.h
libkea_dhcpsrv_la_SOURCES += d2_client_mgr.cc d2_client_mgr.h
86
libkea_dhcpsrv_la_SOURCES += daemon.cc daemon.h
87
libkea_dhcpsrv_la_SOURCES += dhcpsrv_log.cc dhcpsrv_log.h
88
libkea_dhcpsrv_la_SOURCES += host.cc host.h
89
libkea_dhcpsrv_la_SOURCES += host_container.h
90
libkea_dhcpsrv_la_SOURCES += host_mgr.cc host_mgr.h
91
libkea_dhcpsrv_la_SOURCES += hosts_log.cc hosts_log.h
92 93
libkea_dhcpsrv_la_SOURCES += key_from_key.h
libkea_dhcpsrv_la_SOURCES += lease.cc lease.h
94
libkea_dhcpsrv_la_SOURCES += lease_file_loader.h
Shawn Routhier's avatar
Shawn Routhier committed
95
libkea_dhcpsrv_la_SOURCES += lease_file_stats.h
96 97
libkea_dhcpsrv_la_SOURCES += lease_mgr.cc lease_mgr.h
libkea_dhcpsrv_la_SOURCES += lease_mgr_factory.cc lease_mgr_factory.h
98
libkea_dhcpsrv_la_SOURCES += logging.cc logging.h
99
libkea_dhcpsrv_la_SOURCES += logging_info.cc logging_info.h
100
libkea_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
101
libkea_dhcpsrv_la_SOURCES += memfile_lease_storage.h
102

103
if HAVE_MYSQL
104
libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
105
endif
106
if HAVE_PGSQL
107
libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
108
endif
109 110
libkea_dhcpsrv_la_SOURCES += option_space_container.h
libkea_dhcpsrv_la_SOURCES += pool.cc pool.h
111
libkea_dhcpsrv_la_SOURCES += srv_config.cc srv_config.h
112
libkea_dhcpsrv_la_SOURCES += subnet.cc subnet.h
113
libkea_dhcpsrv_la_SOURCES += subnet_id.h
114
libkea_dhcpsrv_la_SOURCES += subnet_selector.h
115 116
libkea_dhcpsrv_la_SOURCES += triplet.h
libkea_dhcpsrv_la_SOURCES += utils.h
117
libkea_dhcpsrv_la_SOURCES += writable_host_data_source.h
118

119 120 121 122 123 124 125 126
# Configuration parsers
libkea_dhcpsrv_la_SOURCES += parsers/dhcp_config_parser.h
libkea_dhcpsrv_la_SOURCES += parsers/dbaccess_parser.cc
libkea_dhcpsrv_la_SOURCES += parsers/dbaccess_parser.h
libkea_dhcpsrv_la_SOURCES += parsers/dhcp_parsers.cc
libkea_dhcpsrv_la_SOURCES += parsers/dhcp_parsers.h
libkea_dhcpsrv_la_SOURCES += parsers/host_reservation_parser.cc
libkea_dhcpsrv_la_SOURCES += parsers/host_reservation_parser.h
127
libkea_dhcpsrv_la_SOURCES += parsers/host_reservations_list_parser.h
128 129
libkea_dhcpsrv_la_SOURCES += parsers/ifaces_config_parser.cc
libkea_dhcpsrv_la_SOURCES += parsers/ifaces_config_parser.h
130

131

132
nodist_libkea_dhcpsrv_la_SOURCES = dhcpsrv_messages.h dhcpsrv_messages.cc
133
nodist_libkea_dhcpsrv_la_SOURCES += hosts_messages.h hosts_messages.cc
134 135 136 137 138 139 140 141 142 143 144

libkea_dhcpsrv_la_CXXFLAGS = $(AM_CXXFLAGS)
libkea_dhcpsrv_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
libkea_dhcpsrv_la_LIBADD   = $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/log/libkea-log.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/util/libkea-util.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libkea-hooks.la
145
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
146 147

libkea_dhcpsrv_la_LDFLAGS  = -no-undefined -version-info 3:0:0
148
if HAVE_MYSQL
149
libkea_dhcpsrv_la_LDFLAGS += $(MYSQL_LIBS)
150
endif
151
if HAVE_PGSQL
152
libkea_dhcpsrv_la_LDFLAGS += $(PGSQL_LIBS)
153
endif
154 155 156 157

if USE_CLANGPP
# Disable unused parameter warning caused by some of the
# Boost headers when compiling with clang.
158
libkea_dhcpsrv_la_CXXFLAGS += -Wno-unused-parameter
159 160
endif

161
# The message file should be in the distribution
162
EXTRA_DIST += dhcpsrv_messages.mes
163
EXTRA_DIST += hosts_messages.mes
164

165 166 167
# Distribute backend documentation
# Database schema creation script moved to src/bin/admin
EXTRA_DIST += database_backends.dox libdhcpsrv.dox
168 169

install-data-local:
170
	$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
171 172