2
0

Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ifeq ($(SRCDIR),)
  2. updir = $(shell echo $(dir $(1)) | sed 's/.$$//')
  3. SRCDIR := $(call updir,$(CURDIR))
  4. BLDDIR := $(SRCDIR)
  5. endif
  6. SUBDIR := include
  7. include $(BLDDIR)/config.mk
  8. default: all
  9. all: xmlrpc-c/config.h
  10. xmlrpc-c/config.h: $(BLDDIR)/$(SUBDIR)/xmlrpc-c
  11. >$@
  12. @echo "Lots of echoes to '$@' suppressed here ..."
  13. @echo '#ifndef XMLRPC_C_CONFIG_H_INCLUDED' >>$@
  14. @echo '#define XMLRPC_C_CONFIG_H_INCLUDED' >>$@
  15. @echo '' >>$@
  16. @echo '/* This file, part of XML-RPC For C/C++, is meant to ' >>$@
  17. @echo ' define characteristics of this particular installation '>>$@
  18. @echo ' that the other <xmlrpc-c/...> header files need in ' >>$@
  19. @echo ' order to compile correctly when #included in Xmlrpc-c' >>$@
  20. @echo ' user code.' >>$@
  21. @echo '' >>$@
  22. @echo ' Those header files #include this one.' >>$@
  23. @echo '' >>$@
  24. @echo ' This file was created by a make rule.' >>$@
  25. @echo '*/' >>$@
  26. @echo '#define XMLRPC_HAVE_WCHAR $(HAVE_WCHAR_H_DEFINE)' >>$@
  27. @echo '#ifdef WIN32' >>$@
  28. @echo ' /* SOCKET is a type defined by <winsock.h>. Anyone who' >>$@
  29. @echo ' uses XMLRPC_SOCKET on a WIN32 system must #include' >>$@
  30. @echo ' <winsock.h>' >>$@
  31. @echo ' */' >>$@
  32. @echo ' #define XMLRPC_SOCKET SOCKET' >>$@
  33. @echo ' #define XMLRPC_HAVE_TIMEVAL 0' >>$@
  34. @echo ' #define XMLRPC_HAVE_TIMESPEC 0' >>$@
  35. @echo ' #define XMLRPC_HAVE_PTHREAD 0' >>$@
  36. @echo '#else' >>$@
  37. @echo ' #define XMLRPC_SOCKET int' >>$@
  38. @echo ' #define XMLRPC_HAVE_TIMEVAL 1' >>$@
  39. @echo ' #define XMLRPC_HAVE_TIMESPEC 1' >>$@
  40. @echo ' #define XMLRPC_HAVE_PTHREAD 1' >>$@
  41. @echo '#endif' >>$@
  42. @echo '' >>$@
  43. @echo '#if defined(_MSC_VER)' >>$@
  44. @echo ' /* Newer MSVC has long long, but MSVC 6 does not */' >>$@
  45. @echo ' #define XMLRPC_INT64 __int64' >>$@
  46. @echo ' #define XMLRPC_PRId64 "I64"' >>$@
  47. @echo ' #define XMLRPC_INT32 __int32' >>$@
  48. @echo '#else' >>$@
  49. @echo ' #define XMLRPC_INT64 long long' >>$@
  50. @echo ' #define XMLRPC_PRId64 "lld"' >>$@
  51. @echo ' #define XMLRPC_INT32 int' >>$@
  52. @echo '#endif' >>$@
  53. @echo '#endif' >>$@
  54. $(BLDDIR)/$(SUBDIR)/xmlrpc-c:
  55. mkdir $@
  56. COMPAT_LINK_CMDS = \
  57. $(LN_S) xmlrpc-c/oldxmlrpc.h xmlrpc.h; \
  58. $(LN_S) xmlrpc-c/server.h xmlrpc_server.h; \
  59. $(LN_S) xmlrpc-c/server_abyss.h xmlrpc_abyss.h; \
  60. $(LN_S) xmlrpc-c/server_w32httpsys.h xmlrpc_server_w32httpsys.h; \
  61. HEADERS_TO_INSTALL = \
  62. xmlrpc-c/config.h \
  63. xmlrpc-c/inttypes.h \
  64. xmlrpc-c/c_util.h \
  65. xmlrpc-c/util.h \
  66. xmlrpc-c/base.h \
  67. xmlrpc-c/json.h \
  68. xmlrpc-c/abyss.h \
  69. xmlrpc-c/abyss_unixsock.h \
  70. xmlrpc-c/abyss_winsock.h \
  71. xmlrpc-c/server.h \
  72. xmlrpc-c/server_abyss.h \
  73. xmlrpc-c/server_w32httpsys.h \
  74. xmlrpc-c/oldxmlrpc.h \
  75. ifeq ($(ENABLE_CPLUSPLUS),yes)
  76. HEADERS_TO_INSTALL += \
  77. xmlrpc-c/oldcppwrapper.hpp \
  78. xmlrpc-c/girerr.hpp \
  79. xmlrpc-c/girmem.hpp \
  80. xmlrpc-c/base.hpp \
  81. xmlrpc-c/timeout.hpp \
  82. xmlrpc-c/xml.hpp \
  83. xmlrpc-c/registry.hpp \
  84. xmlrpc-c/server_abyss.hpp \
  85. xmlrpc-c/packetsocket.hpp \
  86. xmlrpc-c/server_pstream.hpp \
  87. COMPAT_LINK_CMDS += $(LN_S) xmlrpc-c/oldcppwrapper.hpp XmlRpcCpp.h;
  88. endif
  89. HEADERINST_PREFIX = /xmlrpc-c
  90. ifeq ($(MUST_BUILD_CLIENT),yes)
  91. HEADERS_TO_INSTALL += \
  92. xmlrpc-c/client.h \
  93. xmlrpc-c/transport.h \
  94. xmlrpc-c/client_global.h \
  95. COMPAT_LINK_CMDS += $(LN_S) xmlrpc-c/client.h xmlrpc_client.h;
  96. ifeq ($(ENABLE_CPLUSPLUS),yes)
  97. HEADERS_TO_INSTALL += \
  98. xmlrpc-c/client.hpp \
  99. xmlrpc-c/client_transport.hpp \
  100. xmlrpc-c/client_simple.hpp \
  101. endif
  102. endif
  103. ifeq ($(ENABLE_CGI_SERVER),yes)
  104. HEADERS_TO_INSTALL += xmlrpc-c/server_cgi.h
  105. COMPAT_LINK_CMDS += $(LN_S) xmlrpc-c/server_cgi.h xmlrpc_cgi.h;
  106. endif
  107. default: all
  108. all:
  109. .PHONY: install-compat-hdr
  110. install-compat-hdr: install-headers
  111. # Install old names of header files for backward compatibility
  112. cd $(DESTDIR)$(HEADERINST_DIR); \
  113. rm -f xmlrpc.h xmlrpc_client.h xmlrpc_server.h xmlrpc_cgi.h \
  114. xmlrpc_server_abyss.h xmlrpc_abyss.h \
  115. xmlrpc_server_w32httpsys.h \
  116. XmlRpcCpp.h; \
  117. $(COMPAT_LINK_CMDS)
  118. .PHONY: install
  119. install: install-common install-compat-hdr
  120. .PHONY: clean
  121. clean:
  122. rm -f xmlrpc-c/config.h
  123. .PHONY: distclean
  124. distclean: clean
  125. .PHONY: check
  126. check:
  127. .PHONY: dep
  128. dep:
  129. OMIT_CONFIG_H_RULE = Y
  130. include $(SRCDIR)/common.mk