initial load of upstream version 1.06.32
[xmlrpc-c] / src / cpp / test / Makefile
1 ifeq ($(SRCDIR)x,x)
2 SRCDIR = $(CURDIR)/../../..
3 endif
4 SUBDIR = src/test/cpp
5 # BLDDIR is for use in places where a symbolic link won't work.
6 # BUILDDIR is for places in Makefile.common that can use the 'blddir'
7 # symbolic link (but in other directories, doesn't).
8 BLDDIR = ../../..
9 BUILDDIR = blddir
10 VPATH = .:$(SRCDIR)
11
12 include $(BLDDIR)/Makefile.config
13
14 PROGS = test
15
16 default: all
17
18 all: $(PROGS)
19
20 XMLRPC_C_CONFIG = $(BUILDDIR)/xmlrpc-c-config.test
21
22 CXXFLAGS = $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
23
24 LDFLAGS += $(shell $(XMLRPC_C_CONFIG) client --ldadd)
25
26 ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
27   LDFLAGS += $(shell curl-config --libs)
28 endif
29 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
30   LDFLAGS += $(shell libwww-config --libs)
31 endif
32
33 LDFLAGS += "-lpthread"
34
35 LDFLAGS += $(LADD)
36
37 INCLUDES = -Isrcdir/include -Iblddir -Isrcdir -Isrcdir/lib/util/include
38
39 # This 'Makefile' dependency makes sure the symlinks get built before
40 # this make file is used for anything.
41
42 Makefile: blddir srcdir
43
44 include $(SRCDIR)/Makefile.common
45
46
47 TEST_OBJS = test.o server_abyss.o tools.o
48
49 ifeq ($(MUST_BUILD_CLIENT),yes)
50   TEST_OBJS += testclient.o
51   CLIENT_LIBS = $(LIBXMLRPC_CLIENT++) $(LIBXMLRPC_CLIENT_A)
52 else
53   TEST_OBJS += testclient_dummy.o
54   CLIENT_LIBS =
55 endif
56
57
58 test:$(TEST_OBJS) $(LIBXMLRPC_SERVER_ABYSS++) $(LIBXMLRPC_SERVER++) \
59   $(CLIENT_LIBS) $(LIBXMLRPC++) $(LIBXMLRPC_CPP) \
60   $(LIBXMLRPC_SERVER_ABYSS_A) $(LIBXMLRPC_SERVER_A) \
61   $(LIBXMLRPC_A) $(LIBXMLRPC_ABYSS_A) $(LIBXMLRPC_XML) $(LIBXMLRPC_UTIL_A) 
62         $(LIBTOOL) --mode=link $(CXXLD) -o $@ $(LDFLAGS) $^
63
64 %.o:%.cpp
65         $(CXX) -c $(INCLUDES) $(CXXFLAGS) $<
66
67 # Note the difference between 'check' and 'runtests'.  'check' means to check
68 # our own correctness.  'runtests' means to run the tests that check our
69 # parent's correctness
70
71 .PHONY: check
72 check:
73
74 .PHONY: runtests
75 runtests: test
76         ./test
77
78 .PHONY: install
79 install:
80
81 .PHONY: clean clean-local distclean
82 clean: clean-common clean-local
83 clean-local:
84         rm -f $(PROGS)
85
86 distclean: clean distclean-common
87
88 .PHONY: dep
89 dep: dep-common
90
91 include Makefile.depend