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

3
SUBDIRS = . testutils tests
4

5 6 7
dhcp_data_dir = @localstatedir@/@PACKAGE@

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib -DDHCP_DATA_DIR="\"$(dhcp_data_dir)\""
8
AM_CPPFLAGS += -DTOP_BUILDDIR="\"$(top_builddir)\""
9 10 11 12
AM_CPPFLAGS += $(BOOST_INCLUDES)
if HAVE_MYSQL
AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
endif
13 14 15
if HAVE_PGSQL
AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
endif
16

17
AM_CXXFLAGS = $(KEA_CXXFLAGS)
18

19 20 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 =
EXTRA_DIST += dbaccess_parser.cc dbaccess_parser.h
EXTRA_DIST += dhcp_parsers.cc dhcp_parsers.h
EXTRA_DIST += host_reservation_parser.cc host_reservation_parser.h
29
EXTRA_DIST += host_reservations_list_parser.h
30

31
# Define rule to build logging source files from message file
32 33 34
dhcpsrv_messages.h dhcpsrv_messages.cc: s-messages

s-messages: dhcpsrv_messages.mes
35
	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/dhcpsrv/dhcpsrv_messages.mes
36
	touch $@
37

38 39 40
# Tell Automake that the dhcpsrv_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
41 42 43 44 45
# anyway), there is no guarantee as to exactly _when_ in the build they will be
# 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

46 47 48 49 50 51
# 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)

52
# Make sure the generated files are deleted in a "clean" operation
53
CLEANFILES = *.gcno *.gcda dhcpsrv_messages.h dhcpsrv_messages.cc s-messages
54 55
# Remove CSV files created by the CSVLeaseFile6 and CSVLeaseFile4 unit tests.
CLEANFILES += *.csv
56

57 58 59 60
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
61
libkea_dhcpsrv_la_SOURCES += base_host_data_source.h
62
libkea_dhcpsrv_la_SOURCES += callout_handle_store.h
63
libkea_dhcpsrv_la_SOURCES += cfg_hosts.cc cfg_hosts.h
64
libkea_dhcpsrv_la_SOURCES += cfg_iface.cc cfg_iface.h
65
libkea_dhcpsrv_la_SOURCES += cfg_option.cc cfg_option.h
66
libkea_dhcpsrv_la_SOURCES += cfg_option_def.cc cfg_option_def.h
67
libkea_dhcpsrv_la_SOURCES += cfg_subnets4.cc cfg_subnets4.h
68
libkea_dhcpsrv_la_SOURCES += cfg_subnets6.cc cfg_subnets6.h
69
libkea_dhcpsrv_la_SOURCES += cfgmgr.cc cfgmgr.h
70 71 72 73
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
74
libkea_dhcpsrv_la_SOURCES += daemon.cc daemon.h
75
libkea_dhcpsrv_la_SOURCES += dhcpsrv_log.cc dhcpsrv_log.h
76
libkea_dhcpsrv_la_SOURCES += host.cc host.h
77
libkea_dhcpsrv_la_SOURCES += host_container.h
78 79 80 81
libkea_dhcpsrv_la_SOURCES += key_from_key.h
libkea_dhcpsrv_la_SOURCES += lease.cc lease.h
libkea_dhcpsrv_la_SOURCES += lease_mgr.cc lease_mgr.h
libkea_dhcpsrv_la_SOURCES += lease_mgr_factory.cc lease_mgr_factory.h
82
libkea_dhcpsrv_la_SOURCES += logging.cc logging.h
83
libkea_dhcpsrv_la_SOURCES += logging_info.cc logging_info.h
84
libkea_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
85

86
if HAVE_MYSQL
87
libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
88
endif
89
if HAVE_PGSQL
90
libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
91
endif
92 93
libkea_dhcpsrv_la_SOURCES += option_space_container.h
libkea_dhcpsrv_la_SOURCES += pool.cc pool.h
94
libkea_dhcpsrv_la_SOURCES += srv_config.cc srv_config.h
95
libkea_dhcpsrv_la_SOURCES += subnet.cc subnet.h
96
libkea_dhcpsrv_la_SOURCES += subnet_id.h
97
libkea_dhcpsrv_la_SOURCES += subnet_selector.h
98 99 100
libkea_dhcpsrv_la_SOURCES += triplet.h
libkea_dhcpsrv_la_SOURCES += utils.h

101 102 103 104 105 106 107 108
# 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
109 110
libkea_dhcpsrv_la_SOURCES += parsers/host_reservations_list_parser.h

111

112 113 114 115 116 117 118 119 120 121 122 123
nodist_libkea_dhcpsrv_la_SOURCES = dhcpsrv_messages.h dhcpsrv_messages.cc

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
124
libkea_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
125 126

libkea_dhcpsrv_la_LDFLAGS  = -no-undefined -version-info 3:0:0
127
if HAVE_MYSQL
128
libkea_dhcpsrv_la_LDFLAGS += $(MYSQL_LIBS)
129
endif
130
if HAVE_PGSQL
131
libkea_dhcpsrv_la_LDFLAGS += $(PGSQL_LIBS)
132
endif
133 134 135 136

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

140
# The message file should be in the distribution
141
EXTRA_DIST += dhcpsrv_messages.mes
142

143
# Distribute MySQL schema creation script and backend documentation
144 145
EXTRA_DIST += dhcpdb_create.mysql dhcpdb_create.pgsql database_backends.dox libdhcpsrv.dox
dist_pkgdata_DATA = dhcpdb_create.mysql dhcpdb_create.pgsql
146 147

install-data-local:
148
	$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
149 150