Makefile.vc 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1999 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. #***************************************************************************
  22. !IF "$(MODE)"=="static"
  23. TARGET = $(LIB_NAME_STATIC)
  24. AS_DLL = false
  25. CFGSET=true
  26. !ELSEIF "$(MODE)"=="dll"
  27. TARGET = $(LIB_NAME_DLL)
  28. AS_DLL = true
  29. CFGSET=true
  30. !ELSE
  31. !MESSAGE Invalid mode: $(MODE)
  32. #######################
  33. # Usage
  34. #
  35. !MESSAGE See winbuild/README.md for usage
  36. !ERROR please choose a valid mode
  37. !ENDIF
  38. !INCLUDE "../lib/Makefile.inc"
  39. LIBCURL_OBJS=$(CSOURCES:.c=.obj)
  40. !INCLUDE "../src/Makefile.inc"
  41. # tool_hugehelp has a special rule
  42. CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=)
  43. CURL_OBJS=$(CURL_OBJS:.c=.obj)
  44. # backwards compatible check for USE_SSPI
  45. !IFDEF USE_SSPI
  46. ENABLE_SSPI = $(USE_SSPI)
  47. !ENDIF
  48. # default options
  49. !IFNDEF MACHINE
  50. # Note: nmake magically changes the value of PROCESSOR_ARCHITECTURE from "AMD64"
  51. # to "x86" when building in a 32 bit build environment on a 64 bit machine.
  52. !IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64"
  53. MACHINE = x64
  54. !ELSE
  55. MACHINE = x86
  56. !ENDIF
  57. !ENDIF
  58. !IFNDEF ENABLE_IDN
  59. USE_IDN = true
  60. !ELSEIF "$(ENABLE_IDN)"=="yes"
  61. USE_IDN = true
  62. !ELSEIF "$(ENABLE_IDN)"=="no"
  63. USE_IDN = false
  64. !ENDIF
  65. !IFNDEF ENABLE_IPV6
  66. USE_IPV6 = true
  67. !ELSEIF "$(ENABLE_IPV6)"=="yes"
  68. USE_IPV6 = true
  69. !ELSEIF "$(ENABLE_IPV6)"=="no"
  70. USE_IPV6 = false
  71. !ENDIF
  72. !IFNDEF ENABLE_SSPI
  73. USE_SSPI = true
  74. !ELSEIF "$(ENABLE_SSPI)"=="yes"
  75. USE_SSPI = true
  76. !ELSEIF "$(ENABLE_SSPI)"=="no"
  77. USE_SSPI = false
  78. !ENDIF
  79. !IFNDEF ENABLE_SCHANNEL
  80. !IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS)
  81. USE_SCHANNEL = false
  82. !ELSE
  83. USE_SCHANNEL = $(USE_SSPI)
  84. !ENDIF
  85. !ELSEIF "$(ENABLE_SCHANNEL)"=="yes"
  86. USE_SCHANNEL = true
  87. !ELSEIF "$(ENABLE_SCHANNEL)"=="no"
  88. USE_SCHANNEL = false
  89. !ENDIF
  90. !IFNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
  91. ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
  92. !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="yes"
  93. !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
  94. ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
  95. !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="no"
  96. !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
  97. ENABLE_OPENSSL_AUTO_LOAD_CONFIG = false
  98. !ENDIF
  99. !IFNDEF ENABLE_UNICODE
  100. USE_UNICODE = false
  101. !ELSEIF "$(ENABLE_UNICODE)"=="yes"
  102. USE_UNICODE = true
  103. !ELSEIF "$(ENABLE_UNICODE)"=="no"
  104. USE_UNICODE = false
  105. !ENDIF
  106. CONFIG_NAME_LIB = libcurl
  107. !IF "$(WITH_SSL)"=="dll"
  108. USE_SSL = true
  109. SSL = dll
  110. !ELSEIF "$(WITH_SSL)"=="static"
  111. USE_SSL = true
  112. SSL = static
  113. !ENDIF
  114. !IF "$(ENABLE_NGHTTP2)"=="yes"
  115. # compatibility bit, WITH_NGHTTP2 is the correct flag
  116. WITH_NGHTTP2 = dll
  117. USE_NGHTTP2 = true
  118. NGHTTP2 = dll
  119. !ELSEIF "$(WITH_NGHTTP2)"=="dll"
  120. USE_NGHTTP2 = true
  121. NGHTTP2 = dll
  122. !ELSEIF "$(WITH_NGHTTP2)"=="static"
  123. USE_NGHTTP2 = true
  124. NGHTTP2 = static
  125. !ENDIF
  126. !IFNDEF USE_NGHTTP2
  127. USE_NGHTTP2 = false
  128. !ENDIF
  129. !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
  130. USE_MBEDTLS = true
  131. MBEDTLS = $(WITH_MBEDTLS)
  132. !ENDIF
  133. !IF "$(WITH_CARES)"=="dll"
  134. USE_CARES = true
  135. CARES = dll
  136. !ELSEIF "$(WITH_CARES)"=="static"
  137. USE_CARES = true
  138. CARES = static
  139. !ENDIF
  140. !IF "$(WITH_ZLIB)"=="dll"
  141. USE_ZLIB = true
  142. ZLIB = dll
  143. !ELSEIF "$(WITH_ZLIB)"=="static"
  144. USE_ZLIB = true
  145. ZLIB = static
  146. !ENDIF
  147. !IF "$(WITH_SSH2)"=="dll"
  148. USE_SSH2 = true
  149. SSH2 = dll
  150. !ELSEIF "$(WITH_SSH2)"=="static"
  151. USE_SSH2 = true
  152. SSH2 = static
  153. !ENDIF
  154. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE)
  155. !IF "$(DEBUG)"=="yes"
  156. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
  157. !ELSE
  158. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
  159. !ENDIF
  160. !IF "$(AS_DLL)"=="true"
  161. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
  162. !ELSE
  163. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
  164. !ENDIF
  165. !IF "$(USE_SSL)"=="true"
  166. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
  167. !ENDIF
  168. !IF "$(USE_MBEDTLS)"=="true"
  169. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS)
  170. !ENDIF
  171. !IF "$(USE_CARES)"=="true"
  172. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
  173. !ENDIF
  174. !IF "$(USE_ZLIB)"=="true"
  175. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
  176. !ENDIF
  177. !IF "$(USE_SSH2)"=="true"
  178. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
  179. !ENDIF
  180. !IF "$(USE_IPV6)"=="true"
  181. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
  182. !ENDIF
  183. !IF "$(USE_SSPI)"=="true"
  184. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
  185. !ENDIF
  186. !IF "$(USE_SCHANNEL)"=="true"
  187. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-schannel
  188. !ENDIF
  189. !IF "$(USE_NGHTTP2)"=="true"
  190. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2)
  191. !ENDIF
  192. !MESSAGE configuration name: $(CONFIG_NAME_LIB)
  193. BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
  194. LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
  195. CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
  196. DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
  197. $(MODE):
  198. @SET DIROBJ=$(LIBCURL_DIROBJ)
  199. @SET MACRO_NAME=LIBCURL_OBJS
  200. @SET OUTFILE=LIBCURL_OBJS.inc
  201. @CALL gen_resp_file.bat $(LIBCURL_OBJS)
  202. @SET DIROBJ=$(CURL_DIROBJ)
  203. @SET MACRO_NAME=CURL_OBJS
  204. @SET OUTFILE=CURL_OBJS.inc
  205. @CALL gen_resp_file.bat $(CURL_OBJS)
  206. @SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB)
  207. @SET MACHINE=$(MACHINE)
  208. @SET USE_NGHTTP2=$(USE_NGHTTP2)
  209. @SET USE_IDN=$(USE_IDN)
  210. @SET USE_IPV6=$(USE_IPV6)
  211. @SET USE_SSPI=$(USE_SSPI)
  212. @SET USE_SCHANNEL=$(USE_SCHANNEL)
  213. @SET USE_UNICODE=$(USE_UNICODE)
  214. # compatibility bit
  215. @SET WITH_NGHTTP2=$(WITH_NGHTTP2)
  216. @$(MAKE) /NOLOGO /F MakefileBuild.vc
  217. copy_from_lib:
  218. echo copying .c...
  219. FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\
  220. clean:
  221. $(MAKE) /NOLOGO /F MakefileBuild.vc $@