1 # Where to find the c-ares source code; needed because the tests use library-internal headers
3 # Where to find the built c-ares static library
5 AUTOMAKE_OPTIONS = foreign
6 ACLOCAL_AMFLAGS = -I ../m4
7 GMOCK_DIR = gmock-1.7.0
8 GTEST_DIR = $(GMOCK_DIR)/gtest
9 # Note use of -isystem to force use of local gMock/gTest even if there's an installed version.
10 CPPFLAGS += -I$(ARES_SRC_DIR) -isystem $(GTEST_DIR)/include -isystem $(GMOCK_DIR)/include
11 CXXFLAGS += -Wall $(PTHREAD_CFLAGS)
13 # Makefile.inc provides the TESTSOURCES, TESTHEADERS and FUZZSOURCES defines
16 TESTS = arestest fuzzcheck.sh
18 noinst_PROGRAMS = arestest aresfuzz aresfuzzname dnsdump
19 arestest_SOURCES = $(TESTSOURCES) $(TESTHEADERS)
20 arestest_LDADD = libgmock.la libgtest.la $(ARES_BLD_DIR)/libcares.la $(PTHREAD_LIBS)
22 # Not interested in coverage of test code, but linking the test binary needs the coverage option
24 arestest_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
26 noinst_LTLIBRARIES = libgmock.la libgtest.la
28 libgmock_la_SOURCES = $(GMOCK_DIR)/src/gmock-all.cc \
29 $(GMOCK_DIR)/src/gmock-cardinalities.cc \
30 $(GMOCK_DIR)/src/gmock-internal-utils.cc \
31 $(GMOCK_DIR)/src/gmock-matchers.cc \
32 $(GMOCK_DIR)/src/gmock-spec-builders.cc \
33 $(GMOCK_DIR)/src/gmock.cc \
34 $(GMOCK_DIR)/include/gmock/gmock-cardinalities.h \
35 $(GMOCK_DIR)/include/gmock/gmock-generated-matchers.h \
36 $(GMOCK_DIR)/include/gmock/gmock-more-actions.h \
37 $(GMOCK_DIR)/include/gmock/gmock-actions.h \
38 $(GMOCK_DIR)/include/gmock/gmock-generated-actions.h \
39 $(GMOCK_DIR)/include/gmock/gmock-matchers.h \
40 $(GMOCK_DIR)/include/gmock/gmock-generated-function-mockers.h \
41 $(GMOCK_DIR)/include/gmock/gmock.h \
42 $(GMOCK_DIR)/include/gmock/gmock-generated-nice-strict.h \
43 $(GMOCK_DIR)/include/gmock/gmock-spec-builders.h \
44 $(GMOCK_DIR)/include/gmock/internal/gmock-internal-utils.h \
45 $(GMOCK_DIR)/include/gmock/internal/gmock-generated-internal-utils.h \
46 $(GMOCK_DIR)/include/gmock/internal/gmock-port.h \
47 $(GMOCK_DIR)/include/gmock/gmock-more-matchers.h
49 libgmock_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR)
51 libgtest_la_SOURCES = $(GTEST_DIR)/src/gtest-all.cc \
52 $(GTEST_DIR)/src/gtest.cc \
53 $(GTEST_DIR)/src/gtest-death-test.cc \
54 $(GTEST_DIR)/src/gtest-filepath.cc \
55 $(GTEST_DIR)/src/gtest-port.cc \
56 $(GTEST_DIR)/src/gtest-printers.cc \
57 $(GTEST_DIR)/src/gtest-test-part.cc \
58 $(GTEST_DIR)/src/gtest-typed-test.cc \
59 $(GTEST_DIR)/src/gtest-internal-inl.h \
60 $(GTEST_DIR)/include/gtest/gtest-test-part.h \
61 $(GTEST_DIR)/include/gtest/gtest-param-test.h \
62 $(GTEST_DIR)/include/gtest/gtest-printers.h \
63 $(GTEST_DIR)/include/gtest/gtest-message.h \
64 $(GTEST_DIR)/include/gtest/gtest.h \
65 $(GTEST_DIR)/include/gtest/gtest_pred_impl.h \
66 $(GTEST_DIR)/include/gtest/gtest-death-test.h \
67 $(GTEST_DIR)/include/gtest/gtest-spi.h \
68 $(GTEST_DIR)/include/gtest/gtest-typed-test.h \
69 $(GTEST_DIR)/include/gtest/internal/gtest-filepath.h \
70 $(GTEST_DIR)/include/gtest/internal/gtest-param-util-generated.h \
71 $(GTEST_DIR)/include/gtest/internal/gtest-type-util.h \
72 $(GTEST_DIR)/include/gtest/internal/gtest-string.h \
73 $(GTEST_DIR)/include/gtest/internal/gtest-port.h \
74 $(GTEST_DIR)/include/gtest/internal/gtest-param-util.h \
75 $(GTEST_DIR)/include/gtest/internal/gtest-death-test-internal.h \
76 $(GTEST_DIR)/include/gtest/internal/gtest-linked_ptr.h \
77 $(GTEST_DIR)/include/gtest/internal/gtest-internal.h \
78 $(GTEST_DIR)/include/gtest/internal/gtest-tuple.h \
79 $(GTEST_DIR)/include/gtest/gtest_prod.h
81 libgtest_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR)
83 aresfuzz_SOURCES = $(FUZZSOURCES)
84 aresfuzz_LDADD = $(ARES_BLD_DIR)/libcares.la
86 aresfuzzname_SOURCES = $(FUZZNAMESOURCES)
87 aresfuzzname_LDADD = $(ARES_BLD_DIR)/libcares.la
89 dnsdump_SOURCES = $(DUMPSOURCES)
90 dnsdump_LDADD = $(ARES_BLD_DIR)/libcares.la