Menu

[r1391]: / advanced / src / cpp / test / Makefile  Maximize  Restore  History

Download this file

108 lines (77 with data), 2.3 kB

  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
ifeq ($(SRCDIR),)
updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
SRCCPPDIR := $(call updir,$(CURDIR))
srcDIR := $(call updir,$(SRCCPPDIR))
SRCDIR := $(call updir,$(srcDIR))
BLDDIR := $(SRCDIR)
endif
SUBDIR := src/test/cpp
include $(BLDDIR)/Makefile.config
PROGS = test
default: all
all: $(PROGS)
XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
CXXFLAGS = $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
LDFLAGS += $(shell $(XMLRPC_C_CONFIG) client --ldadd)
ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
LDFLAGS += $(shell curl-config --libs)
endif
ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
LDFLAGS += $(shell libwww-config --libs)
endif
LDFLAGS += "-lpthread"
LDFLAGS += $(LADD)
INCLUDES = -Isrcdir/include -I$(BLDDIR) -Isrcdir -Isrcdir/lib/util/include
# This 'Makefile' dependency makes sure the symlinks get built before
# this make file is used for anything.
Makefile: srcdir
include $(SRCDIR)/Makefile.common
TEST_OBJS = test.o registry.o server_abyss.o server_pstream.o tools.o
ifeq ($(MUST_BUILD_CLIENT),yes)
TEST_OBJS += testclient.o
CLIENT_LIBS = $(LIBXMLRPC_CLIENTPP_A) $(LIBXMLRPC_CLIENT_A)
else
TEST_OBJS += testclient_dummy.o
CLIENT_LIBS =
endif
TEST_LIBS = \
$(LIBXMLRPC_SERVER_ABYSSPP_A) \
$(LIBXMLRPC_SERVER_PSTREAMPP_A) \
$(LIBXMLRPC_SERVERPP_A) \
$(CLIENT_LIBS) $(LIBXMLRPCPP_A) \
$(LIBXMLRPC_CPP_A) \
$(LIBXMLRPC_SERVER_ABYSS_A) \
$(LIBXMLRPC_SERVER_A) \
$(LIBXMLRPC_A) \
$(LIBXMLRPC_ABYSS_A) \
$(LIBXMLRPC_PACKETSOCKET_A) \
$(LIBXMLRPC_UTIL_A) \
ifneq ($(ENABLE_LIBXML2_BACKEND),yes)
# We're using the internal Expat XML parser
TEST_LIBS += $(LIBXMLRPC_XMLPARSE_A) $(LIBXMLRPC_XMLTOK_A)
LDADD_XML =
else
LDADD_XML = $(shell xml2-config --libs)
endif
test: $(TEST_OBJS) $(TEST_LIBS)
$(CXXLD) -o $@ $(LDFLAGS) $(LDADD_XML) $^
%.o:%.cpp
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $<
# 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: clean clean-local distclean
clean: clean-common clean-local
clean-local:
rm -f $(PROGS)
distclean: clean distclean-common
.PHONY: dep
dep: dep-common
include Makefile.depend
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.