blob: da771aba3a4b5bc87d1eed90ec57806bf7354cd8 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# Where to find the c-ares source code; needed because the tests use library-internal headers
2ARES_SRC_DIR = ..
3# Where to find the built c-ares static library
4ARES_BLD_DIR = ..
5AUTOMAKE_OPTIONS = foreign
6ACLOCAL_AMFLAGS = -I ../m4
7GMOCK_DIR = gmock-1.7.0
8GTEST_DIR = $(GMOCK_DIR)/gtest
9# Note use of -isystem to force use of local gMock/gTest even if there's an installed version.
10CPPFLAGS += -I$(ARES_SRC_DIR) -isystem $(GTEST_DIR)/include -isystem $(GMOCK_DIR)/include
11CXXFLAGS += -Wall $(PTHREAD_CFLAGS)
12
13# Makefile.inc provides the TESTSOURCES, TESTHEADERS and FUZZSOURCES defines
14include Makefile.inc
15
16TESTS = arestest fuzzcheck.sh
17
18noinst_PROGRAMS = arestest aresfuzz dnsdump
19arestest_SOURCES = $(TESTSOURCES) $(TESTHEADERS)
20arestest_LDADD = libgmock.la libgtest.la $(ARES_BLD_DIR)/libcares.la $(PTHREAD_LIBS)
21
22# Not interested in coverage of test code, but linking the test binary needs the coverage option
23@CODE_COVERAGE_RULES@
24arestest_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
25
26noinst_LTLIBRARIES = libgmock.la libgtest.la
27
28libgmock_la_SOURCES = $(GMOCK_DIR)/src/gmock-all.cc
29libgmock_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR)
30libgtest_la_SOURCES = $(GTEST_DIR)/src/gtest-all.cc
31libgtest_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR)
32
33aresfuzz_SOURCES = $(FUZZSOURCES)
34aresfuzz_LDADD = $(ARES_BLD_DIR)/libcares.la
35
36dnsdump_SOURCES = $(DUMPSOURCES)
37dnsdump_LDADD = $(ARES_BLD_DIR)/libcares.la
38
39test: check