lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #***************************************************************************
|
| 2 | # _ _ ____ _
|
| 3 | # Project ___| | | | _ \| |
|
| 4 | # / __| | | | |_) | |
|
| 5 | # | (__| |_| | _ <| |___
|
| 6 | # \___|\___/|_| \_\_____|
|
| 7 | #
|
| 8 | # Copyright (C) 1999 - 2016, 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 | ###########################################################################
|
| 24 | #
|
| 25 | # Makefile for building libcurl with MSVC 6, 7, 8, 9, 10, 11, 12 and 14
|
| 26 | #
|
| 27 | # Usage: see usage message below
|
| 28 | # Should be invoked from winbuild directory
|
| 29 | # Edit the paths and desired library name
|
| 30 | # SSL path is only required if you intend compiling
|
| 31 | # with SSL.
|
| 32 | #
|
| 33 | # This make file leaves the result either a .lib or .dll file
|
| 34 | # in the \lib directory. It should be called from the \lib
|
| 35 | # directory.
|
| 36 | #
|
| 37 | # An option would have been to allow the source directory to
|
| 38 | # be specified, but I saw no requirement.
|
| 39 | #
|
| 40 | # Another option would have been to leave the .lib and .dll
|
| 41 | # files in the "cfg" directory, but then the make file
|
| 42 | # in \src would need to be changed.
|
| 43 | #
|
| 44 | ##############################################################
|
| 45 |
|
| 46 | CFGSET=FALSE
|
| 47 | WINBUILD_DIR=`cd`
|
| 48 | ZIP = zip.exe
|
| 49 |
|
| 50 | # Allow changing C compiler via environment variable CC (default cl.exe)
|
| 51 | # This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx
|
| 52 | !If "$(CC)" == ""
|
| 53 | CC = cl.exe
|
| 54 | !Endif
|
| 55 |
|
| 56 | !IF "$(VC)"=="6"
|
| 57 | CC_NODEBUG = $(CC) /O2 /DNDEBUG
|
| 58 | CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ
|
| 59 | CFLAGS = /I. /I../lib /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
|
| 60 | !ELSE
|
| 61 | CC_NODEBUG = $(CC) /O2 /DNDEBUG
|
| 62 | CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd /W3
|
| 63 | CFLAGS = /I. /I ../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
|
| 64 | !ENDIF
|
| 65 |
|
| 66 | LFLAGS = /nologo /machine:$(MACHINE)
|
| 67 | LNKDLL = link.exe /DLL
|
| 68 | LNKLIB = link.exe /lib
|
| 69 |
|
| 70 | CFLAGS_PDB = /Zi
|
| 71 | LFLAGS_PDB = /incremental:no /opt:ref,icf
|
| 72 |
|
| 73 | CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB
|
| 74 |
|
| 75 | WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib
|
| 76 |
|
| 77 | BASE_NAME = libcurl
|
| 78 | BASE_NAME_DEBUG = $(BASE_NAME)_debug
|
| 79 | BASE_NAME_STATIC = $(BASE_NAME)_a
|
| 80 | BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug
|
| 81 |
|
| 82 | LIB_NAME_STATIC = $(BASE_NAME_STATIC).lib
|
| 83 | LIB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).lib
|
| 84 | LIB_NAME_DLL = $(BASE_NAME).dll
|
| 85 | LIB_NAME_IMP = $(BASE_NAME).lib
|
| 86 | LIB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).dll
|
| 87 | LIB_NAME_IMP_DEBUG = $(BASE_NAME_DEBUG).lib
|
| 88 |
|
| 89 | PDB_NAME_STATIC = $(BASE_NAME_STATIC).pdb
|
| 90 | PDB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).pdb
|
| 91 | PDB_NAME_DLL = $(BASE_NAME).pdb
|
| 92 | PDB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).pdb
|
| 93 |
|
| 94 | # CURL Command section
|
| 95 | PROGRAM_NAME = curl.exe
|
| 96 | CURL_CFLAGS = /I../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c
|
| 97 | CURL_LFLAGS = /nologo /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE)
|
| 98 | CURL_RESFLAGS = /i../include
|
| 99 |
|
| 100 | #############################################################
|
| 101 | ## Nothing more to do below this line!
|
| 102 | LIBCURL_SRC_DIR = ..\lib
|
| 103 | CURL_SRC_DIR = ..\src
|
| 104 |
|
| 105 | !IFNDEF WITH_DEVEL
|
| 106 | WITH_DEVEL = ../../deps
|
| 107 | !ENDIF
|
| 108 | DEVEL_INCLUDE = $(WITH_DEVEL)/include
|
| 109 | DEVEL_LIB = $(WITH_DEVEL)/lib
|
| 110 | DEVEL_BIN = $(WITH_DEVEL)/bin
|
| 111 |
|
| 112 | CFLAGS = $(CFLAGS) /I"$(DEVEL_INCLUDE)"
|
| 113 | LFLAGS = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)"
|
| 114 |
|
| 115 |
|
| 116 | !IF "$(WITH_SSL)"=="dll"
|
| 117 | !IF EXISTS("$(DEVEL_LIB)\libssl.lib")
|
| 118 | SSL_LIBS = libssl.lib libcrypto.lib
|
| 119 | !ELSE
|
| 120 | SSL_LIBS = libeay32.lib ssleay32.lib
|
| 121 | !ENDIF
|
| 122 | USE_SSL = true
|
| 123 | SSL = dll
|
| 124 | !ELSEIF "$(WITH_SSL)"=="static"
|
| 125 | !IF EXISTS("$(DEVEL_LIB)\libssl.lib")
|
| 126 | SSL_LIBS = libssl.lib libcrypto.lib gdi32.lib user32.lib crypt32.lib
|
| 127 | !ELSE
|
| 128 | SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib crypt32.lib
|
| 129 | !ENDIF
|
| 130 | USE_SSL = true
|
| 131 | SSL = static
|
| 132 | !ENDIF
|
| 133 |
|
| 134 | !IFDEF USE_SSL
|
| 135 | SSL_CFLAGS = /DUSE_OPENSSL /I"$(DEVEL_INCLUDE)/openssl"
|
| 136 | !ENDIF
|
| 137 |
|
| 138 | !IF "$(WITH_NGHTTP2)"=="dll"
|
| 139 | NGHTTP2_CFLAGS = /DUSE_NGHTTP2
|
| 140 | NGHTTP2_LIBS = nghttp2.lib
|
| 141 | !ELSEIF "$(WITH_NGHTTP2)"=="static"
|
| 142 | NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB
|
| 143 | NGHTTP2_LIBS = nghttp2_static.lib
|
| 144 | !ENDIF
|
| 145 |
|
| 146 | !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
|
| 147 | USE_MBEDTLS = true
|
| 148 | MBEDTLS = $(WITH_MBEDTLS)
|
| 149 | MBEDTLS_CFLAGS = /DUSE_MBEDTLS
|
| 150 | MBEDTLS_LIBS = mbedtls.lib mbedcrypto.lib mbedx509.lib
|
| 151 | !ENDIF
|
| 152 |
|
| 153 |
|
| 154 | !IF "$(WITH_CARES)"=="dll"
|
| 155 | !IF "$(DEBUG)"=="yes"
|
| 156 | CARES_LIBS = caresd.lib
|
| 157 | !ELSE
|
| 158 | CARES_LIBS = cares.lib
|
| 159 | !ENDIF
|
| 160 | USE_CARES = true
|
| 161 | CARES = dll
|
| 162 | !ELSEIF "$(WITH_CARES)"=="static"
|
| 163 | !IF "$(DEBUG)"=="yes"
|
| 164 | CARES_LIBS = libcaresd.lib
|
| 165 | !ELSE
|
| 166 | CARES_LIBS = libcares.lib
|
| 167 | !ENDIF
|
| 168 | USE_CARES = true
|
| 169 | CARES = static
|
| 170 | !ENDIF
|
| 171 |
|
| 172 | !IFDEF USE_CARES
|
| 173 | CARES_CFLAGS = /DUSE_ARES /I"$(DEVEL_INCLUDE)/cares"
|
| 174 | !ENDIF
|
| 175 |
|
| 176 | !IF "$(WITH_ZLIB)"=="dll"
|
| 177 | ZLIB_LIBS = zlib.lib
|
| 178 | USE_ZLIB = true
|
| 179 | ZLIB = dll
|
| 180 | !ELSEIF "$(WITH_ZLIB)"=="static"
|
| 181 | ZLIB_LIBS = zlib_a.lib
|
| 182 | USE_ZLIB = true
|
| 183 | ZLIB = static
|
| 184 | !ENDIF
|
| 185 |
|
| 186 | !IFDEF USE_ZLIB
|
| 187 | ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ
|
| 188 | !ENDIF
|
| 189 |
|
| 190 |
|
| 191 | !IF "$(WITH_SSH2)"=="dll"
|
| 192 | SSH2_LIBS = libssh2.lib
|
| 193 | USE_SSH2 = true
|
| 194 | SSH2 = dll
|
| 195 | !ELSEIF "$(WITH_SSH2)"=="static"
|
| 196 | SSH2_LIBS = libssh2_a.lib user32.lib
|
| 197 | USE_SSH2 = true
|
| 198 | SSH2 = static
|
| 199 | !ENDIF
|
| 200 |
|
| 201 | !IFDEF USE_SSH2
|
| 202 | SSH2_CFLAGS = /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /DUSE_LIBSSH2
|
| 203 | SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(WITH_DEVEL)/include/libssh2
|
| 204 | !ENDIF
|
| 205 |
|
| 206 |
|
| 207 | !IFNDEF USE_IDN
|
| 208 | USE_IDN = true
|
| 209 | !ELSEIF "$(USE_IDN)"=="yes"
|
| 210 | USE_IDN = true
|
| 211 | !ENDIF
|
| 212 |
|
| 213 | !IF "$(USE_IDN)"=="true"
|
| 214 | IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES
|
| 215 | WIN_LIBS = $(WIN_LIBS) Normaliz.lib
|
| 216 | !ENDIF
|
| 217 |
|
| 218 |
|
| 219 | !IFNDEF USE_IPV6
|
| 220 | USE_IPV6 = true
|
| 221 | !ELSEIF "$(USE_IPV6)"=="yes"
|
| 222 | USE_IPV6 = true
|
| 223 | !ENDIF
|
| 224 |
|
| 225 | !IF "$(USE_IPV6)"=="true"
|
| 226 | IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6
|
| 227 | !ENDIF
|
| 228 |
|
| 229 |
|
| 230 | !IFNDEF USE_SSPI
|
| 231 | USE_SSPI = true
|
| 232 | !ELSEIF "$(USE_SSPI)"=="yes"
|
| 233 | USE_SSPI = true
|
| 234 | !ENDIF
|
| 235 |
|
| 236 | !IF "$(USE_SSPI)"=="true"
|
| 237 | SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI
|
| 238 | !ENDIF
|
| 239 |
|
| 240 |
|
| 241 | !IFNDEF USE_WINSSL
|
| 242 | !IF "$(USE_SSL)"=="true"
|
| 243 | USE_WINSSL = false
|
| 244 | !ELSE
|
| 245 | USE_WINSSL = $(USE_SSPI)
|
| 246 | !ENDIF
|
| 247 | !ELSEIF "$(USE_WINSSL)"=="yes"
|
| 248 | USE_WINSSL = true
|
| 249 | !ENDIF
|
| 250 |
|
| 251 |
|
| 252 | !IF "$(USE_WINSSL)"=="true"
|
| 253 | !IF "$(USE_SSPI)"!="true"
|
| 254 | !ERROR cannot build with WinSSL without SSPI
|
| 255 | !ENDIF
|
| 256 | SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL
|
| 257 | WIN_LIBS = $(WIN_LIBS) Crypt32.lib
|
| 258 | !ENDIF
|
| 259 |
|
| 260 |
|
| 261 | !IF "$(GEN_PDB)"=="yes"
|
| 262 | GEN_PDB = true
|
| 263 | !ENDIF
|
| 264 |
|
| 265 |
|
| 266 | !IFDEF EMBED_MANIFEST
|
| 267 | MANIFESTTOOL = mt -manifest $(DIRDIST)\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\$(PROGRAM_NAME);1
|
| 268 | !ENDIF
|
| 269 |
|
| 270 | # Runtime library configuration
|
| 271 | !IF "$(RTLIBCFG)"=="static"
|
| 272 | RTLIB = /MT
|
| 273 | RTLIB_DEBUG = /MTd
|
| 274 | !ELSE
|
| 275 | RTLIB = /MD
|
| 276 | RTLIB_DEBUG = /MDd
|
| 277 | !ENDIF
|
| 278 |
|
| 279 | !IF "$(MODE)"=="static"
|
| 280 | TARGET = $(LIB_NAME_STATIC)
|
| 281 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
|
| 282 | AS_DLL = false
|
| 283 | CFGSET = true
|
| 284 | !ELSEIF "$(MODE)"=="dll"
|
| 285 | TARGET = $(LIB_NAME_DLL)
|
| 286 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
|
| 287 | AS_DLL = true
|
| 288 | CFGSET = true
|
| 289 | !ENDIF
|
| 290 |
|
| 291 | !IF "$(CFGSET)" == "FALSE"
|
| 292 | !ERROR please choose a valid mode
|
| 293 | !ENDIF
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 | # CURL_XX macros are for the curl.exe command
|
| 298 |
|
| 299 | !IF "$(DEBUG)"=="yes"
|
| 300 | RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
|
| 301 | CURL_CC = $(CC_DEBUG) $(RTLIB_DEBUG)
|
| 302 | CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc
|
| 303 | !ELSE
|
| 304 | RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
|
| 305 | CURL_CC = $(CC_NODEBUG) $(RTLIB)
|
| 306 | CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc
|
| 307 | !ENDIF
|
| 308 |
|
| 309 | !IF "$(AS_DLL)" == "true"
|
| 310 |
|
| 311 | LNK = $(LNKDLL) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET)
|
| 312 | !IF "$(DEBUG)"=="yes"
|
| 313 | TARGET = $(LIB_NAME_DLL_DEBUG)
|
| 314 | LNK = $(LNK) /DEBUG /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
|
| 315 | PDB = $(PDB_NAME_DLL_DEBUG)
|
| 316 | CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
|
| 317 | !ELSE
|
| 318 | TARGET = $(LIB_NAME_DLL)
|
| 319 | LNK = $(LNK) /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
|
| 320 | PDB = $(PDB_NAME_DLL)
|
| 321 | CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
|
| 322 | !ENDIF
|
| 323 | RESOURCE = $(LIB_DIROBJ)\libcurl.res
|
| 324 |
|
| 325 | # AS_DLL
|
| 326 | !ELSE
|
| 327 |
|
| 328 | !IF "$(DEBUG)"=="yes"
|
| 329 | TARGET = $(LIB_NAME_STATIC_DEBUG)
|
| 330 | PDB = $(PDB_NAME_STATIC_DEBUG)
|
| 331 | !ELSE
|
| 332 | TARGET = $(LIB_NAME_STATIC)
|
| 333 | PDB = $(PDB_NAME_STATIC)
|
| 334 | !ENDIF
|
| 335 | LNK = $(LNKLIB) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET)
|
| 336 | CURL_CC = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC)
|
| 337 |
|
| 338 | # AS_DLL
|
| 339 | !ENDIF
|
| 340 |
|
| 341 | !IF "$(USE_SSL)"=="true"
|
| 342 | CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
|
| 343 | LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)
|
| 344 | !ENDIF
|
| 345 |
|
| 346 | !IF "$(USE_MBEDTLS)"=="true"
|
| 347 | CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS)
|
| 348 | LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS)
|
| 349 | !ENDIF
|
| 350 |
|
| 351 | !IF "$(USE_CARES)"=="true"
|
| 352 | CFLAGS = $(CFLAGS) $(CARES_CFLAGS)
|
| 353 | LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)
|
| 354 | !ENDIF
|
| 355 |
|
| 356 | !IF "$(USE_ZLIB)"=="true"
|
| 357 | CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS)
|
| 358 | LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS)
|
| 359 | !ENDIF
|
| 360 |
|
| 361 | !IF "$(USE_SSH2)"=="true"
|
| 362 | CFLAGS = $(CFLAGS) $(SSH2_CFLAGS)
|
| 363 | LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS)
|
| 364 | !ENDIF
|
| 365 |
|
| 366 | !IF "$(USE_IDN)"=="true"
|
| 367 | CFLAGS = $(CFLAGS) $(IDN_CFLAGS)
|
| 368 | !ENDIF
|
| 369 |
|
| 370 | !IF "$(USE_IPV6)"=="true"
|
| 371 | CFLAGS = $(CFLAGS) $(IPV6_CFLAGS)
|
| 372 | !ENDIF
|
| 373 |
|
| 374 | !IF "$(USE_SSPI)"=="true"
|
| 375 | CFLAGS = $(CFLAGS) $(SSPI_CFLAGS)
|
| 376 | !ENDIF
|
| 377 |
|
| 378 | !IF "$(USE_NGHTTP2)"=="true"
|
| 379 | CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS)
|
| 380 | LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS)
|
| 381 | !ENDIF
|
| 382 |
|
| 383 | !IF "$(GEN_PDB)"=="true"
|
| 384 | CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)"
|
| 385 | LFLAGS = $(LFLAGS) $(LFLAGS_PDB)
|
| 386 | !ENDIF
|
| 387 |
|
| 388 | LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
|
| 389 | CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
|
| 390 | DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
|
| 391 |
|
| 392 | #
|
| 393 | # curl.exe
|
| 394 | #
|
| 395 | CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib"
|
| 396 |
|
| 397 | #!IF "$(CFG)" == "release-ssh2-ssl-dll-zlib"
|
| 398 | #TARGET = $(LIB_NAME_STATIC)
|
| 399 | #LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBS) $(SSH2LIBS) $(SSL_LFLAGS) $(ZLIB_LFLAGS) $(LFLAGSSSH) /out:$(LIB_DIROBJ)\$(TARGET)
|
| 400 | #CC = $(CCNODBG) $(RTLIB) $(SSL_CFLAGS) $(ZLIB_CFLAGS) $(CFLAGSLIB) $(SSH2_CFLAGS)
|
| 401 | #CFGSET = TRUE
|
| 402 | #!ENDIF
|
| 403 |
|
| 404 | #######################
|
| 405 | # Only the clean target can be used if a config was not provided.
|
| 406 | #
|
| 407 | !IF "$(CFGSET)" == "FALSE"
|
| 408 | clean:
|
| 409 | @-erase /s *.dll 2> NUL
|
| 410 | @-erase /s *.exp 2> NUL
|
| 411 | @-erase /s *.idb 2> NUL
|
| 412 | @-erase /s *.lib 2> NUL
|
| 413 | @-erase /s *.obj 2> NUL
|
| 414 | @-erase /s *.pch 2> NUL
|
| 415 | @-erase /s *.pdb 2> NUL
|
| 416 | @-erase /s *.res 2> NUL
|
| 417 | !ELSE
|
| 418 | # A mode was provided, so the library can be built.
|
| 419 | #
|
| 420 | !include CURL_OBJS.inc
|
| 421 | !include LIBCURL_OBJS.inc
|
| 422 |
|
| 423 | !IF "$(AS_DLL)" == "true"
|
| 424 | LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE)
|
| 425 | !ELSE
|
| 426 | LIB_OBJS = $(LIBCURL_OBJS)
|
| 427 | !ENDIF
|
| 428 |
|
| 429 | EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res
|
| 430 |
|
| 431 | all : $(TARGET) $(PROGRAM_NAME)
|
| 432 |
|
| 433 | package: $(TARGET)
|
| 434 | @cd $(DIRDIST)
|
| 435 | @-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1
|
| 436 | @cd $(MAKEDIR)
|
| 437 |
|
| 438 | $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DISTDIR)
|
| 439 | @echo Using SSL: $(USE_SSL)
|
| 440 | @echo Using NGHTTP2: $(USE_NGHTTP2)
|
| 441 | @echo Using c-ares: $(USE_CARES)
|
| 442 | @echo Using SSH2: $(USE_SSH2)
|
| 443 | @echo Using ZLIB: $(USE_ZLIB)
|
| 444 | @echo Using IDN: $(USE_IDN)
|
| 445 | @echo Using IPv6: $(USE_IPV6)
|
| 446 | @echo Using SSPI: $(USE_SSPI)
|
| 447 | @echo Using WinSSL: $(USE_WINSSL)
|
| 448 | @echo CFLAGS: $(CFLAGS)
|
| 449 | @echo LFLAGS: $(LFLAGS)
|
| 450 | @echo GenPDB: $(GEN_PDB)
|
| 451 | @echo Debug: $(DEBUG)
|
| 452 | @echo Machine: $(MACHINE)
|
| 453 | $(LNK) $(LFLAGS) $(LIB_OBJS)
|
| 454 | @echo Copying libs...
|
| 455 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL) $(DIRDIST)\bin\ /y >nul 2<&1
|
| 456 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC) $(DIRDIST)\lib\ /y >nul 2<&1
|
| 457 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1
|
| 458 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1
|
| 459 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP) $(DIRDIST)\lib\ /y >nul 2<&1
|
| 460 | @if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1
|
| 461 | @-copy $(LIB_DIROBJ)\*.exp $(DIRDIST)\lib /y >nul 2<&1
|
| 462 | @-copy $(LIB_DIROBJ)\*.pdb $(DIRDIST)\lib /y >nul 2<&1
|
| 463 | @-copy ..\include\curl\*.h $(DIRDIST)\include\curl\ /y >nul 2<&1
|
| 464 |
|
| 465 | $(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST)
|
| 466 |
|
| 467 | $(DIRDIST):
|
| 468 | @if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin
|
| 469 | @if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include
|
| 470 | @if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl
|
| 471 | @if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib
|
| 472 |
|
| 473 | $(LIB_DIROBJ):
|
| 474 | @if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ)
|
| 475 | @if not exist "$(LIB_DIROBJ)\vauth" mkdir $(LIB_DIROBJ)\vauth
|
| 476 | @if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
|
| 477 |
|
| 478 | $(CURL_DIROBJ):
|
| 479 | @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
|
| 480 | # we need a lib dir for the portability functions from libcurl
|
| 481 | # we use the .c directly here
|
| 482 | @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib
|
| 483 |
|
| 484 | .SUFFIXES: .c .obj .res
|
| 485 |
|
| 486 | {$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj:
|
| 487 | $(CURL_CC) $(CFLAGS) /Fo"$@" $<
|
| 488 |
|
| 489 | {$(LIBCURL_SRC_DIR)\vauth\}.c{$(LIB_DIROBJ)\vauth\}.obj:
|
| 490 | $(CURL_CC) $(CFLAGS) /Fo"$@" $<
|
| 491 |
|
| 492 | {$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj:
|
| 493 | $(CURL_CC) $(CFLAGS) /Fo"$@" $<
|
| 494 |
|
| 495 | $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
|
| 496 | rc $(RC_FLAGS)
|
| 497 |
|
| 498 | #
|
| 499 | # curl.exe
|
| 500 | #
|
| 501 |
|
| 502 |
|
| 503 | !IF "$(MODE)"=="static"
|
| 504 | !IF "$(DEBUG)"=="yes"
|
| 505 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG)
|
| 506 | !ELSE
|
| 507 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
|
| 508 | !ENDIF
|
| 509 | !ELSEIF "$(MODE)"=="dll"
|
| 510 | !IF "$(DEBUG)"=="yes"
|
| 511 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG)
|
| 512 | !ELSE
|
| 513 | CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
|
| 514 | !ENDIF
|
| 515 | !ENDIF
|
| 516 |
|
| 517 | CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \
|
| 518 | $(CURL_DIROBJ)\nonblock.obj \
|
| 519 | $(CURL_DIROBJ)\strtoofft.obj \
|
| 520 | $(CURL_DIROBJ)\warnless.obj
|
| 521 |
|
| 522 | $(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
|
| 523 | $(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
|
| 524 | $(MANIFESTTOOL)
|
| 525 |
|
| 526 | {$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj:
|
| 527 | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" $<
|
| 528 |
|
| 529 | $(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c
|
| 530 | $(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c
|
| 531 | $(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c
|
| 532 | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c
|
| 533 | $(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c
|
| 534 | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c
|
| 535 | $(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c
|
| 536 | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c
|
| 537 | $(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc
|
| 538 | rc $(CURL_RC_FLAGS)
|
| 539 |
|
| 540 | !ENDIF # End of case where a config was provided.
|