1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
ifeq ($(SRCDIR),)
updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
testDIR := $(call updir,$(CURDIR))
SRCDIR := $(call updir,$(testDIR))
BLDDIR := $(SRCDIR)
endif
SUBDIR := test/cpp
include $(BLDDIR)/config.mk
PROGS = test
default: all
all: $(PROGS)
XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
LIBS :=
LIBS += $(SOCKETLIBOPT) $(THREAD_LIBS)
INCLUDES = -Isrcdir/include -I$(BLDDIR) -Isrcdir -Isrcdir/lib/util/include
# This 'common.mk' dependency makes sure the symlinks get built before
# this make file is used for anything.
$(SRCDIR)/common.mk: srcdir blddir
include $(SRCDIR)/common.mk
TEST_OBJS = \
test.o \
base64.o \
registry.o \
server_pstream.o \
tools.o \
value.o \
xml.o \
ifeq ($(MUST_BUILD_CLIENT),yes)
TEST_OBJS += testclient.o
LIBS += $(shell $(XMLRPC_C_CONFIG) client --ldadd)
else
TEST_OBJS += testclient_dummy.o
endif
ifeq ($(ENABLE_ABYSS_SERVER),yes)
TEST_OBJS += abyss.o server_abyss.o
LIBS += $(shell $(XMLRPC_C_CONFIG) abyss-server --ldadd)
else
TEST_OBJS += abyss_dummy.o server_abyss_dummy.o
endif
#-----------------------------------------------------------------------------
# TEST_LIBS
#-----------------------------------------------------------------------------
TEST_LIBS =
ifeq ($(ENABLE_ABYSS_SERVER),yes)
TEST_LIBS += $(LIBXMLRPC_SERVER_ABYSSPP_A)
endif
TEST_LIBS += $(LIBXMLRPC_SERVER_PSTREAMPP_A)
TEST_LIBS += $(LIBXMLRPC_SERVERPP_A)
ifeq ($(MUST_BUILD_CLIENT),yes)
TEST_LIBS += $(LIBXMLRPC_CLIENTPP_A) $(LIBXMLRPC_CLIENT_A)
endif
TEST_LIBS += $(LIBXMLRPCPP_A)
TEST_LIBS += $(LIBXMLRPC_CPP_A)
ifeq ($(ENABLE_ABYSS_SERVER),yes)
TEST_LIBS += $(LIBXMLRPC_SERVER_ABYSS_A)
endif
TEST_LIBS += $(LIBXMLRPC_SERVER_A)
TEST_LIBS += $(LIBXMLRPC_A)
ifeq ($(ENABLE_ABYSS_SERVER),yes)
TEST_LIBS += $(LIBXMLRPC_ABYSS_A)
TEST_LIBS += $(LIBXMLRPC_ABYSSPP_A)
endif
TEST_LIBS += $(LIBXMLRPC_PACKETSOCKET_A)
TEST_LIBS += $(LIBXMLRPC_UTILPP_A)
TEST_LIBS += $(LIBXMLRPC_UTIL_A)
ifeq ($(MSVCRT),yes)
TEST_LIBS += socketpair.o
endif
ifneq ($(ENABLE_LIBXML2_BACKEND),yes)
# We're using the internal Expat XML parser
TEST_LIBS += $(LIBXMLRPC_XMLPARSE_A)
TEST_LIBS += $(LIBXMLRPC_XMLTOK_A)
endif
ifneq ($(ENABLE_LIBXML2_BACKEND),yes)
# We're using the internal Expat XML parser
LIB_XML =
registry.o: D_INTERNAL_EXPAT=-DINTERNAL_EXPAT
else
LIB_XML = $(shell xml2-config --libs)
endif
test: $(TEST_OBJS) $(TEST_LIBS)
$(CXXLD) -o $@ $(LDFLAGS_ALL) $^ $(LIB_XML) $(LIBS)
%.o:%.cpp
$(CXX) -c $(INCLUDES) $(CXXFLAGS_ALL) $(D_INTERNAL_EXPAT) $<
socketpair.o: $(SRCDIR)/Windows/socketpair.cpp
$(CXX) -c $(INCLUDES) $(CXXFLAGS_ALL) $(D_INTERNAL_EXPAT) $<
# Note the difference between 'check' and 'runtests'. 'check' means to check
# our own correctness. 'runtests' means to run the tests that check our
# parent's correctness
.PHONY: check
check:
.PHONY: runtests
runtests: test
./test
.PHONY: install
install:
.PHONY: uninstall
uninstall:
.PHONY: clean clean-local distclean
clean: clean-common clean-local
clean-local:
rm -f $(PROGS)
distclean: clean distclean-common
.PHONY: dep
dep: dep-common
include depend.mk
|