Makefile.am 3.24 KB
Newer Older
1 2 3 4
SUBDIRS = .

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES)
5 6 7
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/dhcp/tests\"
AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"

8 9
AM_CXXFLAGS = $(B10_CXXFLAGS)

10 11 12 13 14 15
# 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)

16 17 18 19 20 21
if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

CLEANFILES = *.gcno *.gcda

22
TESTS_ENVIRONMENT = \
23
	$(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
24

25 26
TESTS =
if HAVE_GTEST
27
TESTS += libdhcp++_unittests libdhcpsrv_unittests
28 29
libdhcp___unittests_SOURCES  = run_unittests.cc
libdhcp___unittests_SOURCES += libdhcp++_unittest.cc
30
libdhcp___unittests_SOURCES += iface_mgr_unittest.cc
31
libdhcp___unittests_SOURCES += lease_mgr_unittest.cc
32 33 34 35 36 37 38
libdhcp___unittests_SOURCES += option6_iaaddr_unittest.cc
libdhcp___unittests_SOURCES += option6_ia_unittest.cc
libdhcp___unittests_SOURCES += option6_addrlst_unittest.cc
libdhcp___unittests_SOURCES += option4_addrlst_unittest.cc
libdhcp___unittests_SOURCES += option_unittest.cc
libdhcp___unittests_SOURCES += pkt6_unittest.cc
libdhcp___unittests_SOURCES += pkt4_unittest.cc
39
libdhcp___unittests_SOURCES += duid_unittest.cc
40

41 42 43
libdhcp___unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
libdhcp___unittests_LDFLAGS  = $(AM_LDFLAGS)  $(GTEST_LDFLAGS)
libdhcp___unittests_CXXFLAGS = $(AM_CXXFLAGS)
44

45
libdhcpsrv_unittests_SOURCES  = run_unittests.cc
46 47
libdhcpsrv_unittests_SOURCES += cfgmgr_unittest.cc triplet_unittest.cc
libdhcpsrv_unittests_SOURCES += pool_unittest.cc subnet_unittest.cc
48
libdhcpsrv_unittests_SOURCES += addr_utilities_unittest.cc
49 50
libdhcpsrv_unittests_SOURCES += alloc_engine_unittest.cc

51 52 53 54 55 56

libdhcpsrv_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
libdhcpsrv_unittests_LDFLAGS  = $(AM_LDFLAGS)  $(GTEST_LDFLAGS)
libdhcpsrv_unittests_CXXFLAGS = $(AM_CXXFLAGS)
libdhcpsrv_unittests_LDADD  = $(GTEST_LDADD)
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
57
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
58
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcpsrv.la
Tomek Mrugalski's avatar
Tomek Mrugalski committed
59
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
60 61


62 63
if USE_CLANGPP
# This is to workaround unused variables tcout and tcerr in
64 65
# log4cplus's streams.h and unused parameters from some of the
# Boost headers.
66
libdhcp___unittests_CXXFLAGS += -Wno-unused-variable -Wno-unused-parameter
67
libdhcpsrv_unittests_CXXFLAGS += -Wno-unused-variable -Wno-unused-parameter
68
endif
69

70
libdhcp___unittests_LDADD  = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
71
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
72
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
73
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
74
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
Tomek Mrugalski's avatar
Tomek Mrugalski committed
75
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
76
libdhcp___unittests_LDADD += $(GTEST_LDADD)
77 78 79
endif

noinst_PROGRAMS = $(TESTS)