initial load of upstream version 1.06.32
[xmlrpc-c] / src / test / Makefile
1 ifeq ($(SRCDIR)x,x)
2 SRCDIR = $(CURDIR)/../..
3 endif
4 SUBDIR = src/test
5 BUILDDIR = $(SRCDIR)
6 VPATH = .:$(SRCDIR)
7
8 include $(BUILDDIR)/Makefile.config
9
10 XMLRPC_C_CONFIG = $(BUILDDIR)/xmlrpc-c-config.test
11
12 LDADD_CLIENT = \
13   $(shell $(XMLRPC_C_CONFIG) client --ldadd)
14 LDADD_ABYSS_SERVER = \
15   $(shell $(XMLRPC_C_CONFIG) abyss-server --ldadd)
16 LDADD_CGI_SERVER = \
17   $(shell $(XMLRPC_C_CONFIG) cgi-server --ldadd)
18
19 default: all
20
21 INCLUDES = -I$(BUILDDIR) -I$(SRCDIR) \
22            -I $(SRCDIR)/include -I$(SRCDIR)/lib/util/include \
23
24 PROGS = test cgitest1
25
26 all: $(PROGS)
27
28 LDFLAGS = $(LADD)
29
30 TEST_OBJS = \
31   test.o \
32   cgi.o \
33   method_registry.o \
34   parse_xml.o \
35   serialize.o \
36   server_abyss.o \
37   value.o \
38   xml_data.o \
39
40 ifeq ($(MUST_BUILD_CLIENT),yes)
41   TEST_OBJS += client.o
42   LIBXMLRPC_CLIENT_DEP = $(LIBXMLRPC_CLIENT)
43 else
44   TEST_OBJS += client_dummy.o
45   LIBXMLRPC_CLIENT_DEP =
46 endif
47
48 include $(SRCDIR)/Makefile.common
49
50 test: $(TEST_OBJS) $(LIBXMLRPC_A) $(LIBXMLRPC_UTIL_A) \
51   $(LIBXMLRPC_SERVER_A) $(LIBXMLRPC_SERVER_ABYSS_A) $(LIBXMLRPC_XML) \
52    $(LIBXMLRPC_CLIENT_DEP) $(LIBXMLRPC_ABYSS_A) $(CASPRINTF)
53         $(CCLD) -o $@ $(LDFLAGS) \
54             $(TEST_OBJS) $(LDADD_CLIENT) $(LDADD_ABYSS_SERVER) $(CASPRINTF)
55
56 cgitest1:%:%.o $(LIBXMLRPC_SERVER_A) $(LIBXMLRPC_SERVER_CGI_A) \
57   $(LIBXMLRPC_A) $(LIBXMLRPC_UTIL_A) $(LIBXMLRPC_XML)
58         $(CCLD) -o $@ $< $(LDFLAGS) $(LDADD_CGI_SERVER)
59
60 CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
61
62 OBJS = $(TEST_OBJS) cgitest1.o
63
64 $(OBJS):%.o:%.c
65         $(CC) -c $(INCLUDES) $(CFLAGS) $<
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 cgitest1
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
92
93