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