Makefile.am 4.18 KB
Newer Older
1 2
SUBDIRS = . tests

3 4 5
dhcp_data_dir = @localstatedir@/@PACKAGE@

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib -DDHCP_DATA_DIR="\"$(dhcp_data_dir)\""
6 7 8 9 10 11 12
AM_CPPFLAGS += $(BOOST_INCLUDES)
if HAVE_MYSQL
AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
endif

AM_CXXFLAGS = $(B10_CXXFLAGS)

13
# Define rule to build logging source files from message file
14 15 16
dhcpsrv_messages.h dhcpsrv_messages.cc: s-messages

s-messages: dhcpsrv_messages.mes
17
	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/dhcpsrv/dhcpsrv_messages.mes
18
	touch $@
19

20 21 22
# 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
23 24 25 26 27
# 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

28 29 30 31 32 33
# 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)

34
# Make sure the generated files are deleted in a "clean" operation
35
CLEANFILES = *.gcno *.gcda dhcpsrv_messages.h dhcpsrv_messages.cc s-messages
36 37 38 39 40

lib_LTLIBRARIES = libb10-dhcpsrv.la
libb10_dhcpsrv_la_SOURCES  =
libb10_dhcpsrv_la_SOURCES += addr_utilities.cc addr_utilities.h
libb10_dhcpsrv_la_SOURCES += alloc_engine.cc alloc_engine.h
41
libb10_dhcpsrv_la_SOURCES += callout_handle_store.h
42
libb10_dhcpsrv_la_SOURCES += csv_lease_file4.cc csv_lease_file4.h
43
libb10_dhcpsrv_la_SOURCES += csv_lease_file6.cc csv_lease_file6.h
44 45
libb10_dhcpsrv_la_SOURCES += d2_client_cfg.cc d2_client_cfg.h
libb10_dhcpsrv_la_SOURCES += d2_client_mgr.cc d2_client_mgr.h
46
libb10_dhcpsrv_la_SOURCES += dbaccess_parser.cc dbaccess_parser.h
47
libb10_dhcpsrv_la_SOURCES += dhcpsrv_log.cc dhcpsrv_log.h
48
libb10_dhcpsrv_la_SOURCES += cfgmgr.cc cfgmgr.h
49
libb10_dhcpsrv_la_SOURCES += dhcp_config_parser.h
50
libb10_dhcpsrv_la_SOURCES += dhcp_parsers.cc dhcp_parsers.h 
51
libb10_dhcpsrv_la_SOURCES += key_from_key.h
52
libb10_dhcpsrv_la_SOURCES += lease.cc lease.h
53 54 55 56 57 58
libb10_dhcpsrv_la_SOURCES += lease_mgr.cc lease_mgr.h
libb10_dhcpsrv_la_SOURCES += lease_mgr_factory.cc lease_mgr_factory.h
libb10_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
if HAVE_MYSQL
libb10_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
endif
59
libb10_dhcpsrv_la_SOURCES += option_space_container.h
60 61 62
libb10_dhcpsrv_la_SOURCES += pool.cc pool.h
libb10_dhcpsrv_la_SOURCES += subnet.cc subnet.h
libb10_dhcpsrv_la_SOURCES += triplet.h
63
libb10_dhcpsrv_la_SOURCES += utils.h
64

65 66
nodist_libb10_dhcpsrv_la_SOURCES = dhcpsrv_messages.h dhcpsrv_messages.cc

67 68 69 70
libb10_dhcpsrv_la_CXXFLAGS = $(AM_CXXFLAGS)
libb10_dhcpsrv_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
libb10_dhcpsrv_la_LIBADD   = $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
71
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/dhcp_ddns/libb10-dhcp_ddns.la
72 73
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libb10-hooks.la
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/log/libb10-log.la
74
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/util/libb10-util.la
75
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/cc/libb10-cc.la
76 77
libb10_dhcpsrv_la_LIBADD  += $(top_builddir)/src/lib/hooks/libb10-hooks.la

78
libb10_dhcpsrv_la_LDFLAGS  = -no-undefined -version-info 3:0:0
79 80 81 82 83 84 85 86 87 88
if HAVE_MYSQL
libb10_dhcpsrv_la_LDFLAGS += $(MYSQL_LIBS)
endif

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

89 90 91
# The message file should be in the distribution
EXTRA_DIST = dhcpsrv_messages.mes

92
# Distribute MySQL schema creation script and backend documentation
93
EXTRA_DIST += dhcpdb_create.mysql database_backends.dox libdhcpsrv.dox
94
dist_pkgdata_DATA = dhcpdb_create.mysql
95 96

install-data-local:
97
	$(mkinstalldirs) $(DESTDIR)$(dhcp_data_dir)
98 99