Makefile.vc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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> - VC versions
  17. !MESSAGE WITH_DEVEL=<path> - Paths for the development files (SSL, zlib, etc.)
  18. !MESSAGE Default 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 USE_SSSPI=<yes or no> - Enable SSPI support, default to yes
  25. !MESSAGE USE_IPV6=<yes or no> - Enable IPV6, default to yes
  26. !MESSAGE DEBUG=<yes or no> - Debug builds
  27. !MESSAGE USE_IDN=<yes or no> - Wheter or not to use IDN Windows APIs. Requires Windows Vista or later.
  28. !MESSAGE or to install http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815
  29. !MESSAGE GEN_PDB=<yes or no> - Generate Program Database (debug symbols release build)
  30. !ERROR please choose a valid mode
  31. !ENDIF
  32. !INCLUDE "../lib/Makefile.inc"
  33. LIBCURL_OBJS=$(CSOURCES:.c=.obj)
  34. top_srcdir=..
  35. !INCLUDE "../src/Makefile.inc"
  36. # hugehelp has a special rule
  37. CURL_OBJS= $(CURL_CFILES:hugehelp.c=)
  38. CURL_OBJS=$(CURL_OBJS:.c=.obj)
  39. # default options
  40. !IFNDEF USE_SSPI
  41. USE_SSPI=true
  42. !ENDIF
  43. !IFNDEF USE_IPV6
  44. USE_IPV6=true
  45. !ENDIF
  46. !IFNDEF USE_IDN
  47. USE_IDN=true
  48. !ENDIF
  49. CONFIG_NAME_LIB = libcurl
  50. !IF "$(WITH_SSL)"=="dll"
  51. USE_SSL = true
  52. SSL=dll
  53. !ELSEIF "$(WITH_SSL)"=="static"
  54. USE_SSL = true
  55. SSL=dll
  56. !ENDIF
  57. !IF "$(WITH_ZLIB)"=="dll"
  58. USE_ZLIB = true
  59. zlib=dll
  60. !ELSEIF "$(WITH_ZLIB)"=="static"
  61. USE_ZLIB = true
  62. ZLIB=static
  63. !ENDIF
  64. !IF "$(WITH_SSH2)"=="dll"
  65. USE_SSH2 = true
  66. SSH2=dll
  67. !ELSEIF "$(WITH_SSH2)"=="static"
  68. USE_SSH2 = true
  69. SSH2=static
  70. !ENDIF
  71. !IF "$(DEBUG)"=="yes"
  72. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
  73. !ELSE
  74. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
  75. !ENDIF
  76. !IF "$(AS_DLL)" == "true"
  77. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
  78. !ELSE
  79. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
  80. !ENDIF
  81. !IF "$(USE_SSL)"=="true"
  82. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
  83. !ENDIF
  84. !IF "$(USE_ZLIB)"=="true"
  85. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
  86. !ENDIF
  87. !IF "$(USE_SSH2)"=="true"
  88. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
  89. !ENDIF
  90. !IF "$(USE_IPV6)"=="true"
  91. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
  92. !ENDIF
  93. !IF "$(USE_SSPI)"=="true"
  94. CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
  95. !ENDIF
  96. !MESSAGE configuration name: $(CONFIG_NAME_LIB)
  97. BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
  98. LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
  99. CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
  100. DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
  101. $(MODE):
  102. @SET LIBCURL_DIROBJ=$(LIBCURL_DIROBJ)
  103. @SET MACRO_NAME=LIBCURL_OBJS
  104. @SET OUTFILE=LIBCURL_OBJS.inc
  105. @gen_resp_file.bat $(LIBCURL_OBJS)
  106. @SET LIBCURL_DIROBJ=$(CURL_DIROBJ)
  107. @SET MACRO_NAME=CURL_OBJS
  108. @SET OUTFILE=CURL_OBJS.inc
  109. @gen_resp_file.bat $(CURL_OBJS)
  110. @$(MAKE) /NOLOGO /F MakefileBuild.vc
  111. copy_from_lib:
  112. echo copying .c...
  113. FOR %%i IN ($(CURLX_ONES:/=\)) DO copy %%i ..\src\