############################################################# # Copyright (C) The c-ares project and its contributors # SPDX-License-Identifier: MIT # # Makefile for building arestest.exe with MingW32 (GCC-3.2) # Use: make -f Makefile.m32 GTEST_ROOT=.... # ######################################################## CXX = g++ CC = gcc LD = g++ ifeq "$(GTEST_ROOT)" "" $(error missing GTEST_ROOT) endif # Where to find the c-ares source code; needed because the tests use library-internal headers ARES_SRC_DIR = .. # Where to find the built c-ares static library ARES_BLD_DIR = .. ARESLIB = $(ARES_BLD_DIR)/src/lib/libcares.a CPPFLAGS = -I$(ARES_SRC_DIR)/include -I$(ARES_SRC_DIR)/src/lib -I$(ARES_SRC_DIR)/src/lib/include -I$(GTEST_ROOT)/include -DCARES_STATICLIB -DCARES_NO_DEPRECATED CXXFLAGS = -Wall $(PTHREAD_CFLAGS) -std=gnu++14 LDFLAGS = LDLIBS = -lws2_32 -liphlpapi # Makefile.inc provides the TESTSOURCES and TESTHEADERS defines include Makefile.inc OBJS := $(patsubst %.cc,%.o,$(strip $(TESTSOURCES))) FUZZOBJS := $(patsubst %.c,%.o,$(strip $(FUZZSOURCES))) FUZZNAMEOBJS := $(patsubst %.c,%.o,$(strip $(FUZZNAMESOURCES))) DNSDUMPOBJS := $(patsubst %.cc,%.o,$(strip $(DUMPSOURCES))) all: arestest.exe aresfuzz.exe aresfuzzname.exe dnsdump.exe arestest.exe: $(OBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) -L$(GTEST_ROOT)/lib -lgmock -lgtest aresfuzz.exe: $(FUZZOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) aresfuzzname.exe: $(FUZZNAMEOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) dnsdump.exe: $(DNSDUMPOBJS) $(LD) $(LDFLAGS) -o $@ $^ -L$(ARES_BLD_DIR)/src/lib -lcares $(LDLIBS) $(OBJS): $(TESTHEADERS) .cc.o: $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -c $< test: arestest.exe ./arestest.exe --gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*LiveGetLocalhostByAddr* vtest: arestest.exe ./arestest.exe -v --gtest_filter=-*LiveSearchTXT*:*LiveSearchANY*:*LiveGetLocalhostByAddr* clean: $(RM) $(OBJS) arestest.exe aresfuzz.exe aresfuzzname.exe dnsdump.exe