lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | # Where to find the c-ares source code; needed because the tests use library-internal headers |
| 2 | ARES_SRC_DIR = .. |
| 3 | # Where to find the built c-ares static library |
| 4 | ARES_BLD_DIR = .. |
| 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) |
| 12 | |
| 13 | # Makefile.inc provides the TESTSOURCES, TESTHEADERS and FUZZSOURCES defines |
| 14 | include Makefile.inc |
| 15 | |
| 16 | TESTS = arestest fuzzcheck.sh |
| 17 | |
| 18 | noinst_PROGRAMS = arestest aresfuzz dnsdump |
| 19 | arestest_SOURCES = $(TESTSOURCES) $(TESTHEADERS) |
| 20 | arestest_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@ |
| 24 | arestest_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) |
| 25 | |
| 26 | noinst_LTLIBRARIES = libgmock.la libgtest.la |
| 27 | |
| 28 | libgmock_la_SOURCES = $(GMOCK_DIR)/src/gmock-all.cc |
| 29 | libgmock_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR) |
| 30 | libgtest_la_SOURCES = $(GTEST_DIR)/src/gtest-all.cc |
| 31 | libgtest_la_CPPFLAGS = -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -isystem $(GMOCK_DIR)/include -I$(GMOCK_DIR) |
| 32 | |
| 33 | aresfuzz_SOURCES = $(FUZZSOURCES) |
| 34 | aresfuzz_LDADD = $(ARES_BLD_DIR)/libcares.la |
| 35 | |
| 36 | dnsdump_SOURCES = $(DUMPSOURCES) |
| 37 | dnsdump_LDADD = $(ARES_BLD_DIR)/libcares.la |
| 38 | |
| 39 | test: check |