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.haxx.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 23!IF "$(MODE)"=="static" 24TARGET = $(LIB_NAME_STATIC) 25AS_DLL = false 26CFGSET=true 27!ELSEIF "$(MODE)"=="dll" 28TARGET = $(LIB_NAME_DLL) 29AS_DLL = true 30CFGSET=true 31!ELSE 32!MESSAGE Invalid mode: $(MODE) 33 34####################### 35# Usage 36# 37 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 curl's sibling directory deps: ../deps 43!MESSAGE Libraries can be fetched at https://windows.php.net/downloads/php-sdk/deps/ 44!MESSAGE Uncompress them into the deps folder. 45!MESSAGE WITH_PREFIX=<path> - Installation directory path 46!MESSAGE Defaults to a configuration dependent (SSL, zlib, etc.) 47!MESSAGE directory inside curl's subdirectory builds: ./builds 48!MESSAGE Use backslashes as path separator 49!MESSAGE WITH_SSL=<dll or static> - Enable OpenSSL support, DLL or static 50!MESSAGE WITH_NGHTTP2=<dll or static> - Enable HTTP/2 support, DLL or static 51!MESSAGE WITH_CARES=<dll or static> - Enable c-ares support, DLL or static 52!MESSAGE WITH_ZLIB=<dll or static> - Enable zlib support, DLL or static 53!MESSAGE WITH_SSH2=<dll or static> - Enable libSSH2 support, DLL or static 54!MESSAGE WITH_MBEDTLS=<dll or static> - Enable mbedTLS support, DLL or static 55!MESSAGE ENABLE_IDN=<yes or no> - Enable use of Windows IDN APIs, defaults to yes 56!MESSAGE Requires Windows Vista or later 57!MESSAGE ENABLE_IPV6=<yes or no> - Enable IPv6, defaults to yes 58!MESSAGE ENABLE_SSPI=<yes or no> - Enable SSPI support, defaults to yes 59!MESSAGE ENABLE_SCHANNEL=<yes or no> - Enable native Windows SSL support, defaults to yes 60!MESSAGE ENABLE_OPENSSL_AUTO_LOAD_CONFIG=<yes or no> 61!MESSAGE - Whether the OpenSSL configuration will be loaded automatically, defaults to yes 62!MESSAGE ENABLE_UNICODE=<yes or no> - Enable UNICODE support, defaults to no 63!MESSAGE GEN_PDB=<yes or no> - Generate Program Database (debug symbols for release build) 64!MESSAGE DEBUG=<yes or no> - Debug builds 65!MESSAGE MACHINE=<x86 or x64> - Target architecture (default x64 on AMD64, x86 on others) 66!MESSAGE CARES_PATH=<path to cares> - Custom path for c-ares 67!MESSAGE MBEDTLS_PATH=<path to mbedTLS> - Custom path for mbedTLS 68!MESSAGE NGHTTP2_PATH=<path to HTTP/2> - Custom path for nghttp2 69!MESSAGE SSH2_PATH=<path to libSSH2> - Custom path for libSSH2 70!MESSAGE SSL_PATH=<path to OpenSSL> - Custom path for OpenSSL 71!MESSAGE ZLIB_PATH=<path to zlib> - Custom path for zlib 72!ERROR please choose a valid mode 73 74!ENDIF 75 76!INCLUDE "../lib/Makefile.inc" 77LIBCURL_OBJS=$(CSOURCES:.c=.obj) 78 79!INCLUDE "../src/Makefile.inc" 80 81# tool_hugehelp has a special rule 82CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=) 83 84CURL_OBJS=$(CURL_OBJS:.c=.obj) 85 86 87# backwards compatible check for USE_SSPI 88!IFDEF USE_SSPI 89ENABLE_SSPI = $(USE_SSPI) 90!ENDIF 91 92# default options 93 94!IFNDEF MACHINE 95# Note: nmake magically changes the value of PROCESSOR_ARCHITECTURE from "AMD64" 96# to "x86" when building in a 32 bit build environment on a 64 bit machine. 97!IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64" 98MACHINE = x64 99!ELSE 100MACHINE = x86 101!ENDIF 102!ENDIF 103 104!IFNDEF ENABLE_IDN 105USE_IDN = true 106!ELSEIF "$(ENABLE_IDN)"=="yes" 107USE_IDN = true 108!ELSEIF "$(ENABLE_IDN)"=="no" 109USE_IDN = false 110!ENDIF 111 112!IFNDEF ENABLE_IPV6 113USE_IPV6 = true 114!ELSEIF "$(ENABLE_IPV6)"=="yes" 115USE_IPV6 = true 116!ELSEIF "$(ENABLE_IPV6)"=="no" 117USE_IPV6 = false 118!ENDIF 119 120!IFNDEF ENABLE_SSPI 121USE_SSPI = true 122!ELSEIF "$(ENABLE_SSPI)"=="yes" 123USE_SSPI = true 124!ELSEIF "$(ENABLE_SSPI)"=="no" 125USE_SSPI = false 126!ENDIF 127 128!IFNDEF ENABLE_SCHANNEL 129!IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS) 130USE_SCHANNEL = false 131!ELSE 132USE_SCHANNEL = $(USE_SSPI) 133!ENDIF 134!ELSEIF "$(ENABLE_SCHANNEL)"=="yes" 135USE_SCHANNEL = true 136!ELSEIF "$(ENABLE_SCHANNEL)"=="no" 137USE_SCHANNEL = false 138!ENDIF 139 140!IFNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG 141ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true 142!ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="yes" 143!UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG 144ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true 145!ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="no" 146!UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG 147ENABLE_OPENSSL_AUTO_LOAD_CONFIG = false 148!ENDIF 149 150!IFNDEF ENABLE_UNICODE 151USE_UNICODE = false 152!ELSEIF "$(ENABLE_UNICODE)"=="yes" 153USE_UNICODE = true 154!ELSEIF "$(ENABLE_UNICODE)"=="no" 155USE_UNICODE = false 156!ENDIF 157 158CONFIG_NAME_LIB = libcurl 159 160!IF "$(WITH_SSL)"=="dll" 161USE_SSL = true 162SSL = dll 163!ELSEIF "$(WITH_SSL)"=="static" 164USE_SSL = true 165SSL = static 166!ENDIF 167 168!IF "$(ENABLE_NGHTTP2)"=="yes" 169# compatibility bit, WITH_NGHTTP2 is the correct flag 170WITH_NGHTTP2 = dll 171USE_NGHTTP2 = true 172NGHTTP2 = dll 173!ELSEIF "$(WITH_NGHTTP2)"=="dll" 174USE_NGHTTP2 = true 175NGHTTP2 = dll 176!ELSEIF "$(WITH_NGHTTP2)"=="static" 177USE_NGHTTP2 = true 178NGHTTP2 = static 179!ENDIF 180 181!IFNDEF USE_NGHTTP2 182USE_NGHTTP2 = false 183!ENDIF 184 185!IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static" 186USE_MBEDTLS = true 187MBEDTLS = $(WITH_MBEDTLS) 188!ENDIF 189 190!IF "$(WITH_CARES)"=="dll" 191USE_CARES = true 192CARES = dll 193!ELSEIF "$(WITH_CARES)"=="static" 194USE_CARES = true 195CARES = static 196!ENDIF 197 198!IF "$(WITH_ZLIB)"=="dll" 199USE_ZLIB = true 200ZLIB = dll 201!ELSEIF "$(WITH_ZLIB)"=="static" 202USE_ZLIB = true 203ZLIB = static 204!ENDIF 205 206!IF "$(WITH_SSH2)"=="dll" 207USE_SSH2 = true 208SSH2 = dll 209!ELSEIF "$(WITH_SSH2)"=="static" 210USE_SSH2 = true 211SSH2 = static 212!ENDIF 213 214CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE) 215 216!IF "$(DEBUG)"=="yes" 217CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug 218!ELSE 219CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release 220!ENDIF 221 222!IF "$(AS_DLL)"=="true" 223CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll 224!ELSE 225CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static 226!ENDIF 227 228!IF "$(USE_SSL)"=="true" 229CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL) 230!ENDIF 231 232!IF "$(USE_MBEDTLS)"=="true" 233CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS) 234!ENDIF 235 236!IF "$(USE_CARES)"=="true" 237CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES) 238!ENDIF 239 240!IF "$(USE_ZLIB)"=="true" 241CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB) 242!ENDIF 243 244!IF "$(USE_SSH2)"=="true" 245CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2) 246!ENDIF 247 248!IF "$(USE_IPV6)"=="true" 249CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6 250!ENDIF 251 252!IF "$(USE_SSPI)"=="true" 253CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi 254!ENDIF 255 256!IF "$(USE_SCHANNEL)"=="true" 257CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-schannel 258!ENDIF 259 260!IF "$(USE_NGHTTP2)"=="true" 261CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2) 262!ENDIF 263 264!MESSAGE configuration name: $(CONFIG_NAME_LIB) 265 266BUILD_DIR=../builds/$(CONFIG_NAME_LIB) 267LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib 268CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl 269DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\ 270 271$(MODE): 272 @SET DIROBJ=$(LIBCURL_DIROBJ) 273 @SET MACRO_NAME=LIBCURL_OBJS 274 @SET OUTFILE=LIBCURL_OBJS.inc 275 @CALL gen_resp_file.bat $(LIBCURL_OBJS) 276 277 @SET DIROBJ=$(CURL_DIROBJ) 278 @SET MACRO_NAME=CURL_OBJS 279 @SET OUTFILE=CURL_OBJS.inc 280 @CALL gen_resp_file.bat $(CURL_OBJS) 281 282 @SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB) 283 @SET MACHINE=$(MACHINE) 284 @SET USE_NGHTTP2=$(USE_NGHTTP2) 285 @SET USE_IDN=$(USE_IDN) 286 @SET USE_IPV6=$(USE_IPV6) 287 @SET USE_SSPI=$(USE_SSPI) 288 @SET USE_SCHANNEL=$(USE_SCHANNEL) 289 @SET USE_UNICODE=$(USE_UNICODE) 290# compatibility bit 291 @SET WITH_NGHTTP2=$(WITH_NGHTTP2) 292 293 @$(MAKE) /NOLOGO /F MakefileBuild.vc 294 295copy_from_lib: 296 echo copying .c... 297 FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\ 298 299clean: 300 $(MAKE) /NOLOGO /F MakefileBuild.vc $@ 301