1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1999 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
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.haxx.se/docs/copyright.html.
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.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 #***************************************************************************
23 !IF "$(MODE)"=="static"
24 TARGET = $(LIB_NAME_STATIC)
27 !ELSEIF "$(MODE)"=="dll"
28 TARGET = $(LIB_NAME_DLL)
32 !MESSAGE Invalid mode: $(MODE)
34 #######################
38 !MESSAGE Usage: nmake /f Makefile.vc mode=<static or dll> <options>
39 !MESSAGE where <options> is one or many of:
40 !MESSAGE VC=<6,7,8,9,10,11,12,14,15> - VC versions
41 !MESSAGE WITH_DEVEL=<path> - Paths for the development files (SSL, zlib, etc.)
42 !MESSAGE Defaults to sibbling directory deps: ../deps
43 !MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/
44 !MESSAGE Uncompress them into the deps folder.
45 !MESSAGE WITH_SSL=<dll or static> - Enable OpenSSL support, DLL or static
46 !MESSAGE WITH_NGHTTP2=<dll or static> - Enable HTTP/2 support, DLL or static
47 !MESSAGE WITH_CARES=<dll or static> - Enable c-ares support, DLL or static
48 !MESSAGE WITH_ZLIB=<dll or static> - Enable zlib support, DLL or static
49 !MESSAGE WITH_SSH2=<dll or static> - Enable libSSH2 support, DLL or static
50 !MESSAGE WITH_MBEDTLS=<dll or static> - Enable mbedTLS support, DLL or static
51 !MESSAGE ENABLE_IDN=<yes or no> - Enable use of Windows IDN APIs, defaults to yes
52 !MESSAGE Requires Windows Vista or later, or installation from:
53 !MESSAGE https://www.microsoft.com/en-us/download/details.aspx?id=734
54 !MESSAGE ENABLE_IPV6=<yes or no> - Enable IPv6, defaults to yes
55 !MESSAGE ENABLE_SSPI=<yes or no> - Enable SSPI support, defaults to yes
56 !MESSAGE ENABLE_WINSSL=<yes or no> - Enable native Windows SSL support, defaults to yes
57 !MESSAGE GEN_PDB=<yes or no> - Generate Program Database (debug symbols for release build)
58 !MESSAGE DEBUG=<yes or no> - Debug builds
59 !MESSAGE MACHINE=<x86 or x64> - Target architecture (default x64 on AMD64, x86 on others)
60 !ERROR please choose a valid mode
64 !INCLUDE "../lib/Makefile.inc"
65 LIBCURL_OBJS=$(CSOURCES:.c=.obj)
67 !INCLUDE "../src/Makefile.inc"
69 # tool_hugehelp has a special rule
70 CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=)
72 CURL_OBJS=$(CURL_OBJS:.c=.obj)
75 # backwards compatible check for USE_SSPI
77 ENABLE_SSPI = $(USE_SSPI)
83 # Note: nmake magically changes the value of PROCESSOR_ARCHITECTURE from "AMD64"
84 # to "x86" when building in a 32 bit build environment on a 64 bit machine.
85 !IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64"
94 !ELSEIF "$(ENABLE_IDN)"=="yes"
96 !ELSEIF "$(ENABLE_IDN)"=="no"
102 !ELSEIF "$(ENABLE_IPV6)"=="yes"
104 !ELSEIF "$(ENABLE_IPV6)"=="no"
110 !ELSEIF "$(ENABLE_SSPI)"=="yes"
112 !ELSEIF "$(ENABLE_SSPI)"=="no"
116 !IFNDEF ENABLE_WINSSL
117 !IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS)
120 USE_WINSSL = $(USE_SSPI)
122 !ELSEIF "$(ENABLE_WINSSL)"=="yes"
124 !ELSEIF "$(ENABLE_WINSSL)"=="no"
128 CONFIG_NAME_LIB = libcurl
130 !IF "$(WITH_SSL)"=="dll"
133 !ELSEIF "$(WITH_SSL)"=="static"
138 !IF "$(ENABLE_NGHTTP2)"=="yes"
139 # compatibility bit, WITH_NGHTTP2 is the correct flag
143 !ELSEIF "$(WITH_NGHTTP2)"=="dll"
146 !ELSEIF "$(WITH_NGHTTP2)"=="static"
155 !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
157 MBEDTLS = $(WITH_MBEDTLS)
160 !IF ( "$(USE_SSL)"=="true" && "$(USE_WINSSL)"=="true" ) \
161 || ( "$(USE_SSL)"=="true" && "$(USE_MBEDTLS)"=="true" ) \
162 || ( "$(USE_MBEDTLS)"=="true" && "$(USE_WINSSL)"=="true" )
163 !ERROR SSL, MBEDTLS and WINSSL are mutual exclusive options.
166 !IF "$(WITH_CARES)"=="dll"
169 !ELSEIF "$(WITH_CARES)"=="static"
174 !IF "$(WITH_ZLIB)"=="dll"
177 !ELSEIF "$(WITH_ZLIB)"=="static"
182 !IF "$(WITH_SSH2)"=="dll"
185 !ELSEIF "$(WITH_SSH2)"=="static"
190 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE)
192 !IF "$(DEBUG)"=="yes"
193 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
195 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
198 !IF "$(AS_DLL)"=="true"
199 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
201 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
204 !IF "$(USE_SSL)"=="true"
205 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
208 !IF "$(USE_MBEDTLS)"=="true"
209 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS)
212 !IF "$(USE_CARES)"=="true"
213 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
216 !IF "$(USE_ZLIB)"=="true"
217 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
220 !IF "$(USE_SSH2)"=="true"
221 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
224 !IF "$(USE_IPV6)"=="true"
225 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
228 !IF "$(USE_SSPI)"=="true"
229 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
232 !IF "$(USE_WINSSL)"=="true"
233 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl
236 !IF "$(USE_NGHTTP2)"=="true"
237 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2)
240 !MESSAGE configuration name: $(CONFIG_NAME_LIB)
242 BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
243 LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
244 CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
245 DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
248 @SET DIROBJ=$(LIBCURL_DIROBJ)
249 @SET MACRO_NAME=LIBCURL_OBJS
250 @SET OUTFILE=LIBCURL_OBJS.inc
251 @CALL gen_resp_file.bat $(LIBCURL_OBJS)
253 @SET DIROBJ=$(CURL_DIROBJ)
254 @SET MACRO_NAME=CURL_OBJS
255 @SET OUTFILE=CURL_OBJS.inc
256 @CALL gen_resp_file.bat $(CURL_OBJS)
258 @SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB)
259 @SET MACHINE=$(MACHINE)
260 @SET USE_NGHTTP2=$(USE_NGHTTP2)
261 @SET USE_IDN=$(USE_IDN)
262 @SET USE_IPV6=$(USE_IPV6)
263 @SET USE_SSPI=$(USE_SSPI)
264 @SET USE_WINSSL=$(USE_WINSSL)
266 @SET WITH_NGHTTP2=$(WITH_NGHTTP2)
268 @$(MAKE) /NOLOGO /F MakefileBuild.vc
272 FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\