initial load of upstream version 1.06.32
[xmlrpc-c] / GNUmakefile
1 ifeq ($(SRCDIR)x,x)
2 SRCDIR = $(CURDIR)
3 endif
4 SUBDIR = .
5 BUILDDIR = $(SRCDIR)
6 VPATH = .:$(SRCDIR)
7
8 include $(SRCDIR)/Makefile.config
9
10 SUBDIRS = include lib src tools examples
11
12 PROGRAMS_TO_INSTALL = xmlrpc-c-config
13
14 # We're in a transition between the bloated, complex GNU
15 # Autoconf/Automake style of build, in which 'configure' creates all
16 # the make files, to simpler static make files.  Some directories have
17 # been converted; some haven't.  So we have the hack of putting
18 # 'xmlrpc_config.h' as the first dependency of 'all' to make sure
19 # 'configure runs before anything in the case that the user neglects
20 # to run 'configure' before doing 'make'.
21
22 default: xmlrpc_config.h all
23
24 .PHONY: all
25 all: xmlrpc-c-config xmlrpc-c-config.test $(SUBDIRS:%=%/all)
26
27 version.h: $(BUILDDIR)/Makefile.config
28         rm -f $@
29         echo '/* This file was generated by a make rule */' >>$@
30         echo '#define XMLRPC_C_VERSION "$(XMLRPC_C_VERSION)"' >>$@
31
32 # We don't want Makefile.common's rule for version.h
33 OMIT_VERSION_H = Y
34
35 # We dont' want Makefile.common's rule for transport_config.h
36 OMIT_TRANSPORT_CONFIG_H = Y
37
38 transport_config.h: $(BUILDDIR)/Makefile.config
39         rm -f $@
40         echo '/* This file was generated by a make rule */' >>$@
41 ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
42         echo '#define MUST_BUILD_WININET_CLIENT 1' >>$@
43 else
44         echo '#define MUST_BUILD_WININET_CLIENT 0' >>$@
45 endif
46 ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
47         echo '#define MUST_BUILD_CURL_CLIENT 1' >>$@
48 else
49         echo '#define MUST_BUILD_CURL_CLIENT 0' >>$@
50 endif
51 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
52         echo '#define MUST_BUILD_LIBWWW_CLIENT 1' >>$@
53 else
54         echo '#define MUST_BUILD_LIBWWW_CLIENT 0' >>$@
55 endif
56         echo "static const char * const XMLRPC_DEFAULT_TRANSPORT =" >>$@
57 ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
58         echo '"libwww";' >>$@
59 else
60   ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
61         echo '"curl";' >>$@
62   else
63     ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
64         echo '"wininet";' >>$@
65     else
66         @echo 'ERROR: no client XML transport configured'; rm $@; false
67     endif
68   endif
69 endif
70
71 .PHONY: clean clean-local
72 clean: $(SUBDIRS:%=%/clean) clean-common clean-local
73
74 clean-local:
75         rm -f transport_config.h
76
77 .PHONY: distclean distclean-local
78 distclean: $(SUBDIRS:%=%/distclean) distclean-common distclean-local
79
80 distclean-local: clean-local
81         rm -f config.log config.status Makefile.config libtool 
82         rm -f xmlrpc_config.h xmlrpc_amconfig.h stamp-h 
83         rm -f xmlrpc-c-config xmlrpc-c-config.test
84
85 check: $(SUBDIRS:%=%/check)
86
87 .PHONY: tags
88 tags: $(SUBDIRS:%=%/tags) TAGS
89
90 DISTFILES = 
91
92 .PHONY: distdir
93 distdir: distdir-common
94
95 .PHONY: install
96 install: $(SUBDIRS:%=%/install) install-common install-compat-hdr
97
98 .PHONY: install-compat-hdr
99 install-compat-hdr:
100 # Install old names of header files for backward compatibility
101         cd $(DESTDIR)$(HEADERINST_DIR); \
102           rm -f xmlrpc.h xmlrpc_client.h xmlrpc_server.h xmlrpc_cgi.h \
103                 xmlrpc_server_abyss.h xmlrpc_abyss.h \
104                 xmlrpc_server_w32httpsys.h \
105                 XmlRpcCpp.h; \
106           $(LN_S) xmlrpc-c/oldxmlrpc.h         xmlrpc.h; \
107           $(LN_S) xmlrpc-c/client.h            xmlrpc_client.h; \
108           $(LN_S) xmlrpc-c/server.h            xmlrpc_server.h; \
109           $(LN_S) xmlrpc-c/server_cgi.h        xmlrpc_cgi.h; \
110           $(LN_S) xmlrpc-c/server_abyss.h      xmlrpc_abyss.h; \
111           $(LN_S) xmlrpc-c/server_w32httpsys.h xmlrpc_server_w32httpsys.h; \
112           $(LN_S) xmlrpc-c/oldcppwrapper.hpp   XmlRpcCpp.h ;\
113
114 .PHONY: dep
115 dep: version.h $(BUILDDIR)/include/xmlrpc-c/config.h $(SUBDIRS:%=%/dep)
116
117 xmlrpc-c-config xmlrpc-c-config.test xmlrpc_config.h xmlrpc_amconfig.h \
118         :%:%.in $(SRCDIR)/configure
119         $(SRCDIR)/configure
120
121 include $(SRCDIR)/Makefile.common