Makefile.vc 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. !IF "$(MODE)"=="static"
  2. TARGET = $(LIB_NAME_STATIC)
  3. AS_DLL = false
  4. CFGSET=true
  5. !ELSEIF "$(MODE)"=="dll"
  6. TARGET = $(LIB_NAME_DLL)
  7. AS_DLL = true
  8. CFGSET=true
  9. !ELSE
  10. !MESSAGE Invalid mode: $(MODE)
  11. #######################
  12. # Usage
  13. #
  14. !MESSAGE Usage: nmake /f Makefile.vc mode=<static or dll> <options>
  15. !MESSAGE where <options> is one or many of:
  16. !MESSAGE VC=<6,7,8,9,10,11,12> - VC versions
  17. !MESSAGE WITH_DEVEL=<path> - Paths for the development files (SSL, zlib, etc.)
  18. !MESSAGE Defaults to sibbling directory deps: ../deps
  19. !MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/
  20. !MESSAGE Uncompress them into the deps folder.
  21. !MESSAGE WITH_SSL=<dll or static> - Enable OpenSSL support, DLL or static
  22. !MESSAGE WITH_ZLIB=<dll or static> - Enable zlib support, DLL or static
  23. !MESSAGE WITH_SSH2=<dll or static> - Enable libSSH2 support, DLL or static
  24. !MESSAGE ENABLE_IDN=<yes or no> - Enable use of Windows IDN APIs, defaults to yes
  25. !MESSAGE Requires Windows Vista or later, or installation from:
  26. !MESSAGE http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815
  27. !MESSAGE ENABLE_IPV6=<yes or no> - Enable IPv6, defaults to yes
  28. !MESSAGE ENABLE_SSPI=<yes or no> - Enable SSPI support, defaults to yes
  29. !MESSAGE ENABLE_WINSSL=<yes or no> - Enable native Windows SSL support, defaults to yes
  30. !MESSAGE GEN_PDB=<yes or no> - Generate Program Database (debug symbols for release build)
  31. !MESSAGE DEBUG=<yes or no> - Debug builds
  32. !MESSAGE MACHINE=<x86 or x64> - Target architecture (default x64 on AMD64, x86 on others)
  33. !ERROR please choose a valid mode
  34. !ENDIF
  35. !INCLUDE "../lib/Makefile.inc"
  36. LIBCURL_OBJS=$(CSOURCES:.c=.obj)
  37. !INCLUDE "../src/Makefile.inc"
  38. # tool_hugehelp has a special rule
  39. CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=)
  40. CURL_OBJS=$(CURL_OBJS:.c=.obj)
  41. # backwards compatible check for USE_SSPI
  42. !IFDEF USE_SSPI
  43. ENABLE_SSPI = $(USE_SSPI)
  44. !ENDIF
  45. # default options
  46. !IFNDEF MACHINE
  47. !IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64"
  48. MACHINE = x64
  49. !ELSE
  50. MACHINE = x86
  51. !ENDIF
  52. !ENDIF
  53. !IFNDEF ENABLE_IDN
  54. USE_IDN = true
  55. !ELSEIF "$(ENABLE_IDN)"=="yes"
  56. USE_IDN = true
  57. !ELSEIF "$(ENABLE_IDN)"=="no"
  58. USE_IDN = false
  59. !ENDIF
  60. !IFNDEF ENABLE_IPV6
  61. USE_IPV6 = true
  62. !ELSEIF "$(ENABLE_IPV6)"=="yes"
  63. USE_IPV6 = true
  64. !ELSEIF "$(ENABLE_IPV6)"=="no"
  65. USE_IPV6 = false
  66. !ENDIF
  67. !IFNDEF ENABLE_SSPI
  68. USE_SSPI = true
  69. !ELSEIF "$(ENABLE_SSPI)"=="yes"
  70. USE_SSPI = true
  71. !ELSEIF "$(ENABLE_SSPI)"=="no"
  72. USE_SSPI = false
  73. !ENDIF
  74. !IFNDEF ENABLE_WINSSL
  75. !IFDEF WITH_SSL
  76. USE_WINSSL = false
  77. !ELSE
  78. USE_WINSSL = $(USE_SSPI)
  79. !ENDIF
  80. !ELSEIF "$(ENABLE_WINSSL)"=="yes"
  81. USE_WINSSL = true
  82. !ELSEIF "$(ENABLE_WINSSL)"=="no"
  83. USE_WINSSL = false
  84. !ENDIF
  85. CONFIG_NAME_LIB = libcurl
  86. !IF "$(WITH_SSL)"=="dll"
  87. USE_SSL = true
  88. SSL = dll
  89. !ELSEIF "$(WITH_SSL)"=="static"
  90. USE_SSL = true
  91. SSL = static
  92. !ENDIF
  93. !IF "$(WITH_ZLIB)"=="dll"
  94. USE_ZLIB = true
  95. ZLIB = dll
  96. !ELSEIF "$(WITH_ZLIB)"=="static"
  97. USE_ZLIB = true
  98. ZLIB = static
  99. !ENDIF
  100. !IF "$(WITH_SSH2)"=="dll"
  101. USE_SSH2 = true
  102. SSH2 = dll
  103. !ELSEIF "$(WITH_SSH2)"=="static"
  104. USE_SSH2 = true
  105. SSH2 = static
  106. !ENDIF
  107. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE)
  108. !IF "$(DEBUG)"=="yes"
  109. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
  110. !ELSE
  111. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
  112. !ENDIF
  113. !IF "$(AS_DLL)"=="true"
  114. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
  115. !ELSE
  116. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
  117. !ENDIF
  118. !IF "$(USE_SSL)"=="true"
  119. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
  120. !ENDIF
  121. !IF "$(USE_ZLIB)"=="true"
  122. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
  123. !ENDIF
  124. !IF "$(USE_SSH2)"=="true"
  125. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
  126. !ENDIF
  127. !IF "$(USE_IPV6)"=="true"
  128. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
  129. !ENDIF
  130. !IF "$(USE_SSPI)"=="true"
  131. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
  132. !ENDIF
  133. !IF "$(USE_WINSSL)"=="true"
  134. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl
  135. !ENDIF
  136. !MESSAGE configuration name: $(CONFIG_NAME_LIB)
  137. BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
  138. LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
  139. CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
  140. DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
  141. $(MODE):
  142. @SET DIROBJ=$(LIBCURL_DIROBJ)
  143. @SET MACRO_NAME=LIBCURL_OBJS
  144. @SET OUTFILE=LIBCURL_OBJS.inc
  145. @gen_resp_file.bat $(LIBCURL_OBJS)
  146. @SET DIROBJ=$(CURL_DIROBJ)
  147. @SET MACRO_NAME=CURL_OBJS
  148. @SET OUTFILE=CURL_OBJS.inc
  149. @gen_resp_file.bat $(CURL_OBJS)
  150. @SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB)
  151. @SET MACHINE=$(MACHINE)
  152. @SET USE_IDN=$(USE_IDN)
  153. @SET USE_IPV6=$(USE_IPV6)
  154. @SET USE_SSPI=$(USE_SSPI)
  155. @SET USE_WINSSL=$(USE_WINSSL)
  156. @$(MAKE) /NOLOGO /F MakefileBuild.vc
  157. copy_from_lib:
  158. echo copying .c...
  159. FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\