"Fossies" - the Fresh Open Source Software Archive

Member "curl-7.66.0/winbuild/MakefileBuild.vc" (9 Sep 2019, 18783 Bytes) of package /linux/www/curl-7.66.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "MakefileBuild.vc": 7.65.3_vs_7.66.0.

    1 #***************************************************************************
    2 #                                  _   _ ____  _
    3 #  Project                     ___| | | |  _ \| |
    4 #                             / __| | | | |_) | |
    5 #                            | (__| |_| |  _ <| |___
    6 #                             \___|\___/|_| \_\_____|
    7 #
    8 # Copyright (C) 1999 - 2018, 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 through to 15
   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 
   49 # Utilities.
   50 # If a path is required that contains characters such as space, quote the path.
   51 MT         = mt.exe
   52 RC         = rc.exe
   53 ZIP        = zip.exe
   54 
   55 # Allow changing C compiler via environment variable CC (default cl.exe)
   56 # This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx
   57 !If "$(CC)" == ""
   58 CC = cl.exe
   59 !Endif
   60 
   61 !IF "$(VC)"=="6"
   62 CC_NODEBUG  = $(CC) /O2 /DNDEBUG
   63 CC_DEBUG    = $(CC) /Od /Gm /Zi /D_DEBUG /GZ
   64 CFLAGS      = /I. /I../lib /I../include /nologo /W4 /wd4127 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
   65 !ELSE
   66 CC_NODEBUG  = $(CC) /O2 /DNDEBUG
   67 CC_DEBUG    = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
   68 CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
   69 !ENDIF
   70 
   71 LFLAGS     = /nologo /machine:$(MACHINE)
   72 LNKDLL     = link.exe /DLL
   73 # Use lib.exe instead of link.exe as link.exe /lib has the following bad habits:
   74 # - optimizing options like /opt:ref raises warnings (at least in Visual Studio 2015)
   75 # - all (including Windows) dependencies are aggregated (as static parts) 
   76 # - link.exe /lib is not documented (anymore) at MSDN
   77 # Instead of id: just create an archive, that contains all objects
   78 LNKLIB     = lib.exe
   79 
   80 CFLAGS_PDB = /Zi
   81 LFLAGS_PDB = /incremental:no /opt:ref,icf /DEBUG
   82 
   83 CFLAGS_LIBCURL_STATIC  = /DCURL_STATICLIB
   84 
   85 WIN_LIBS    = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib
   86 
   87 BASE_NAME              = libcurl
   88 BASE_NAME_DEBUG        = $(BASE_NAME)_debug
   89 BASE_NAME_STATIC       = $(BASE_NAME)_a
   90 BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug
   91 
   92 LIB_NAME_STATIC        = $(BASE_NAME_STATIC).lib
   93 LIB_NAME_STATIC_DEBUG  = $(BASE_NAME_STATIC_DEBUG).lib
   94 LIB_NAME_DLL           = $(BASE_NAME).dll
   95 LIB_NAME_IMP           = $(BASE_NAME).lib
   96 LIB_NAME_DLL_DEBUG     = $(BASE_NAME_DEBUG).dll
   97 LIB_NAME_IMP_DEBUG     = $(BASE_NAME_DEBUG).lib
   98 
   99 PDB_NAME_STATIC        = $(BASE_NAME_STATIC).pdb
  100 PDB_NAME_STATIC_DEBUG  = $(BASE_NAME_STATIC_DEBUG).pdb
  101 PDB_NAME_DLL           = $(BASE_NAME).pdb
  102 PDB_NAME_DLL_DEBUG     = $(BASE_NAME_DEBUG).pdb
  103 
  104 # CURL Command section
  105 PROGRAM_NAME  = curl.exe
  106 CURL_CFLAGS   = /I../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c
  107 CURL_LFLAGS   = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS)
  108 CURL_RESFLAGS = /i../include
  109 
  110 #############################################################
  111 ## Nothing more to do below this line!
  112 LIBCURL_SRC_DIR = ..\lib
  113 CURL_SRC_DIR = ..\src
  114 
  115 !IFNDEF WITH_DEVEL
  116 WITH_DEVEL   = ../../deps
  117 !ENDIF
  118 DEVEL_INCLUDE= $(WITH_DEVEL)/include
  119 DEVEL_LIB    = $(WITH_DEVEL)/lib
  120 
  121 !IF EXISTS("$(DEVEL_INCLUDE)")
  122 CFLAGS       = $(CFLAGS) /I"$(DEVEL_INCLUDE)"
  123 !ENDIF
  124 !IF EXISTS("$(DEVEL_LIB)")
  125 LFLAGS       = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)"
  126 !ENDIF
  127 
  128 !IFDEF SSL_PATH
  129 SSL_INC_DIR  = $(SSL_PATH)\include
  130 SSL_LIB_DIR  = $(SSL_PATH)\lib
  131 SSL_LFLAGS   = $(SSL_LFLAGS) "/LIBPATH:$(SSL_LIB_DIR)"
  132 !ELSE
  133 SSL_INC_DIR=$(DEVEL_INCLUDE)\openssl
  134 SSL_LIB_DIR=$(DEVEL_LIB)
  135 !ENDIF
  136 
  137 !IF "$(WITH_SSL)"=="dll" || "$(WITH_SSL)"=="static"
  138 !IF EXISTS("$(SSL_LIB_DIR)\libssl.lib")
  139 SSL_LIBS     = libssl.lib libcrypto.lib
  140 !ELSE
  141 SSL_LIBS     = libeay32.lib ssleay32.lib
  142 !ENDIF
  143 USE_SSL      = true
  144 SSL          = $(WITH_SSL)
  145 !IF "$(WITH_SSL)"=="static"
  146 WIN_LIBS     = $(WIN_LIBS) gdi32.lib user32.lib crypt32.lib
  147 !ENDIF
  148 !ENDIF
  149 
  150 !IFDEF USE_SSL
  151 SSL_CFLAGS   = /DUSE_OPENSSL /I"$(SSL_INC_DIR)"
  152 !IF EXISTS("$(SSL_INC_DIR)\is_boringssl.h")
  153 SSL_CFLAGS   = $(SSL_CFLAGS) /DHAVE_BORINGSSL
  154 !ENDIF
  155 !IF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="false"
  156 SSL_CFLAGS   = $(SSL_CFLAGS) /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
  157 !ENDIF
  158 !ENDIF
  159 
  160 
  161 !IFDEF NGHTTP2_PATH
  162 NGHTTP2_INC_DIR  = $(NGHTTP2_PATH)\include
  163 NGHTTP2_LIB_DIR  = $(NGHTTP2_PATH)\lib
  164 NGHTTP2_LFLAGS   = $(NGHTTP2_LFLAGS) "/LIBPATH:$(NGHTTP2_LIB_DIR)"
  165 !ELSE
  166 NGHTTP2_INC_DIR  = $(DEVEL_INCLUDE)
  167 NGHTTP2_LIB_DIR  = $(DEVEL_LIB)
  168 !ENDIF
  169 
  170 !IF "$(WITH_NGHTTP2)"=="dll"
  171 NGHTTP2_CFLAGS   = /DUSE_NGHTTP2 /I"$(NGHTTP2_INC_DIR)"
  172 NGHTTP2_LIBS     = nghttp2.lib
  173 !ELSEIF "$(WITH_NGHTTP2)"=="static"
  174 NGHTTP2_CFLAGS   = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB /I"$(NGHTTP2_INC_DIR)"
  175 NGHTTP2_LIBS     = nghttp2_static.lib
  176 !ENDIF
  177 
  178 
  179 !IFDEF MBEDTLS_PATH
  180 MBEDTLS_INC_DIR  = $(MBEDTLS_PATH)\include
  181 MBEDTLS_LIB_DIR  = $(MBEDTLS_PATH)\lib
  182 MBEDTLS_LFLAGS   = $(MBEDTLS_LFLAGS) "/LIBPATH:$(MBEDTLS_LIB_DIR)"
  183 !ELSE
  184 MBEDTLS_INC_DIR  = $(DEVEL_INCLUDE)
  185 MBEDTLS_LIB_DIR  = $(DEVEL_LIB)
  186 !ENDIF
  187 
  188 !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
  189 USE_MBEDTLS    = true
  190 MBEDTLS        = $(WITH_MBEDTLS)
  191 MBEDTLS_CFLAGS = /DUSE_MBEDTLS /I"$(MBEDTLS_INC_DIR)"
  192 MBEDTLS_LIBS   = mbedtls.lib mbedcrypto.lib mbedx509.lib
  193 !ENDIF
  194 
  195 
  196 !IFDEF CARES_PATH
  197 CARES_INC_DIR  = $(CARES_PATH)\include
  198 CARES_LIB_DIR  = $(CARES_PATH)\lib
  199 CARES_LFLAGS   = $(CARES_LFLAGS) "/LIBPATH:$(CARES_LIB_DIR)"
  200 !ELSE
  201 CARES_INC_DIR  = $(DEVEL_INCLUDE)/cares
  202 CARES_LIB_DIR  = $(DEVEL_LIB)
  203 !ENDIF
  204 
  205 !IF "$(WITH_CARES)"=="dll"
  206 !IF "$(DEBUG)"=="yes"
  207 CARES_LIBS     = caresd.lib
  208 !ELSE
  209 CARES_LIBS     = cares.lib
  210 !ENDIF
  211 USE_CARES      = true
  212 CARES          = dll
  213 !ELSEIF "$(WITH_CARES)"=="static"
  214 !IF "$(DEBUG)"=="yes"
  215 CARES_LIBS     = libcaresd.lib
  216 !ELSE
  217 CARES_LIBS     = libcares.lib
  218 !ENDIF
  219 USE_CARES      = true
  220 CARES          = static
  221 !ENDIF
  222 
  223 !IFDEF USE_CARES
  224 CARES_CFLAGS   = /DUSE_ARES /I"$(CARES_INC_DIR)"
  225 !ENDIF
  226 
  227 
  228 !IFDEF ZLIB_PATH
  229 ZLIB_INC_DIR = $(ZLIB_PATH)\include
  230 ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
  231 ZLIB_LFLAGS  = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
  232 !ELSE
  233 ZLIB_INC_DIR = $(DEVEL_INCLUDE)
  234 ZLIB_LIB_DIR = $(DEVEL_LIB)
  235 !ENDIF
  236 
  237 # Depending on how zlib is built the libraries have different names, we 
  238 # try to handle them all. 
  239 !IF "$(WITH_ZLIB)"=="dll"
  240 !IF EXISTS("$(ZLIB_LIB_DIR)\zlibwapi.lib")
  241 ZLIB_LIBS = zlibwapi.lib
  242 ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI
  243 !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib")
  244 ZLIB_LIBS   = zdll.lib
  245 !ELSE
  246 ZLIB_LIBS   = zlib.lib
  247 !ENDIF
  248 USE_ZLIB    = true
  249 ZLIB        = dll
  250 !ELSEIF "$(WITH_ZLIB)"=="static"
  251 !IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib")
  252 ZLIB_LIBS   = zlibstat.lib
  253 ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI
  254 !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib")
  255 ZLIB_LIBS   = zlib.lib
  256 !ELSE
  257 ZLIB_LIBS   = zlib_a.lib
  258 !ENDIF
  259 USE_ZLIB    = true
  260 ZLIB        = static
  261 !ENDIF
  262 
  263 !IFDEF USE_ZLIB
  264 ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ $(ADDITIONAL_ZLIB_CFLAGS) /I"$(ZLIB_INC_DIR)"
  265 !ENDIF
  266 
  267 
  268 !IFDEF SSH2_PATH
  269 SSH2_INC_DIR= $(SSH2_PATH)\include
  270 SSH2_LIB_DIR= $(SSH2_PATH)\lib
  271 SSH2_LFLAGS = $(SSH2_LFLAGS) "/LIBPATH:$(SSH2_LIB_DIR)"
  272 !ELSE
  273 SSH2_LIB_DIR= $(DEVEL_LIB)
  274 SSH2_INC_DIR= $(DEVEL_INCLUDE)/libssh2
  275 !ENDIF
  276 
  277 !IF "$(WITH_SSH2)"=="dll"
  278 SSH2_LIBS   = libssh2.lib
  279 USE_SSH2    = true
  280 SSH2        = dll
  281 !ELSEIF "$(WITH_SSH2)"=="static"
  282 # libssh2 NMakefile on Windows at default creates a static library without _a suffix
  283 !IF EXISTS("$(SSH2_LIB_DIR)\libssh2.lib")
  284 SSH2_LIBS   = libssh2.lib
  285 !ELSE
  286 SSH2_LIBS   = libssh2_a.lib
  287 !ENDIF
  288 WIN_LIBS     = $(WIN_LIBS) user32.lib
  289 USE_SSH2    = true
  290 SSH2        = static
  291 !ENDIF
  292 
  293 !IFDEF USE_SSH2
  294 SSH2_CFLAGS = /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /DUSE_LIBSSH2
  295 SSH2_CFLAGS = $(SSH2_CFLAGS) /I$(SSH2_INC_DIR)
  296 !ENDIF
  297 
  298 
  299 !IFNDEF USE_IDN
  300 USE_IDN   = true
  301 !ELSEIF "$(USE_IDN)"=="yes"
  302 USE_IDN   = true
  303 !ENDIF
  304 
  305 !IF "$(USE_IDN)"=="true"
  306 IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES
  307 WIN_LIBS   = $(WIN_LIBS) Normaliz.lib
  308 !ENDIF
  309 
  310 
  311 !IFNDEF USE_IPV6
  312 USE_IPV6  = true
  313 !ELSEIF "$(USE_IPV6)"=="yes"
  314 USE_IPV6  = true
  315 !ENDIF
  316 
  317 !IF "$(USE_IPV6)"=="true"
  318 IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6
  319 !ENDIF
  320 
  321 
  322 !IFNDEF USE_SSPI
  323 USE_SSPI  = true
  324 !ELSEIF "$(USE_SSPI)"=="yes"
  325 USE_SSPI  = true
  326 !ENDIF
  327 
  328 !IF "$(USE_SSPI)"=="true"
  329 SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI
  330 !ENDIF
  331 
  332 
  333 !IFNDEF USE_WINSSL
  334 !IF "$(USE_SSL)"=="true"
  335 USE_WINSSL  = false
  336 !ELSE
  337 USE_WINSSL  = $(USE_SSPI)
  338 !ENDIF
  339 !ELSEIF "$(USE_WINSSL)"=="yes"
  340 USE_WINSSL  = true
  341 !ENDIF
  342 
  343 
  344 !IF "$(USE_WINSSL)"=="true"
  345 !IF "$(USE_SSPI)"!="true"
  346 !ERROR cannot build with WinSSL without SSPI
  347 !ENDIF
  348 SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL
  349 WIN_LIBS    = $(WIN_LIBS) Crypt32.lib
  350 !ENDIF
  351 
  352 
  353 !IF "$(GEN_PDB)"=="yes"
  354 GEN_PDB = true
  355 !ENDIF
  356 
  357 
  358 !IFDEF EMBED_MANIFEST
  359 MANIFESTTOOL = $(MT) -manifest $(DIRDIST)\bin\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\bin\$(PROGRAM_NAME);1
  360 !ELSE
  361 CURL_RC_FLAGS = $(CURL_RC_FLAGS) /dCURL_EMBED_MANIFEST
  362 !ENDIF
  363 
  364 # Runtime library configuration
  365 !IF "$(RTLIBCFG)"=="static"
  366 RTLIB = /MT
  367 RTLIB_DEBUG = /MTd
  368 !ELSE
  369 RTLIB = /MD
  370 RTLIB_DEBUG  = /MDd
  371 !ENDIF
  372 
  373 !IF "$(MODE)"=="static"
  374 TARGET = $(LIB_NAME_STATIC)
  375 CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
  376 AS_DLL = false
  377 CFGSET = true
  378 !ELSEIF "$(MODE)"=="dll"
  379 TARGET = $(LIB_NAME_DLL)
  380 CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
  381 AS_DLL = true
  382 CFGSET = true
  383 !ENDIF
  384 
  385 !IF "$(CFGSET)" == "FALSE"
  386 !ERROR please choose a valid mode
  387 !ENDIF
  388 
  389 
  390 
  391 # CURL_XX macros are for the curl.exe command
  392 
  393 !IF "$(DEBUG)"=="yes"
  394 RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
  395 CURL_CC       = $(CC_DEBUG) $(RTLIB_DEBUG)
  396 CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc
  397 !ELSE
  398 RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
  399 CURL_CC       = $(CC_NODEBUG) $(RTLIB)
  400 CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc
  401 !ENDIF
  402 
  403 !IF "$(AS_DLL)" == "true"
  404 
  405 LNK       = $(LNKDLL) $(LFLAGS) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET)
  406 !IF "$(DEBUG)"=="yes"
  407 TARGET    = $(LIB_NAME_DLL_DEBUG)
  408 LNK       = $(LNK) /DEBUG /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
  409 PDB       = $(PDB_NAME_DLL_DEBUG)
  410 CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
  411 !ELSE
  412 TARGET    = $(LIB_NAME_DLL)
  413 LNK       = $(LNK)  /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
  414 PDB       = $(PDB_NAME_DLL)
  415 CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
  416 !ENDIF
  417 RESOURCE  = $(LIB_DIROBJ)\libcurl.res
  418 
  419 # AS_DLL
  420 !ELSE
  421 
  422 !IF "$(DEBUG)"=="yes"
  423 TARGET   = $(LIB_NAME_STATIC_DEBUG)
  424 PDB      = $(PDB_NAME_STATIC_DEBUG)
  425 !ELSE
  426 TARGET   = $(LIB_NAME_STATIC)
  427 PDB      = $(PDB_NAME_STATIC)
  428 !ENDIF
  429 LNK      = $(LNKLIB) /out:$(LIB_DIROBJ)\$(TARGET)
  430 CURL_CC  = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC)
  431 
  432 # AS_DLL
  433 !ENDIF
  434 
  435 !IF "$(USE_SSL)"=="true"
  436 CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
  437 LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)
  438 !ENDIF
  439 
  440 !IF "$(USE_MBEDTLS)"=="true"
  441 CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS)
  442 LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS)
  443 !ENDIF
  444 
  445 !IF "$(USE_CARES)"=="true"
  446 CFLAGS = $(CFLAGS) $(CARES_CFLAGS)
  447 LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)
  448 !ENDIF
  449 
  450 !IF "$(USE_ZLIB)"=="true"
  451 CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS)
  452 LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS)
  453 !ENDIF
  454 
  455 !IF "$(USE_SSH2)"=="true"
  456 CFLAGS = $(CFLAGS) $(SSH2_CFLAGS)
  457 LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS)
  458 !ENDIF
  459 
  460 !IF "$(USE_IDN)"=="true"
  461 CFLAGS = $(CFLAGS) $(IDN_CFLAGS)
  462 !ENDIF
  463 
  464 !IF "$(USE_IPV6)"=="true"
  465 CFLAGS = $(CFLAGS) $(IPV6_CFLAGS)
  466 !ENDIF
  467 
  468 !IF "$(USE_SSPI)"=="true"
  469 CFLAGS = $(CFLAGS) $(SSPI_CFLAGS)
  470 !ENDIF
  471 
  472 !IF "$(USE_NGHTTP2)"=="true"
  473 CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS)
  474 LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS)
  475 !ENDIF
  476 
  477 !IF "$(GEN_PDB)"=="true"
  478 CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)"
  479 LFLAGS = $(LFLAGS) $(LFLAGS_PDB)
  480 !ENDIF
  481 
  482 !IF ( "$(USE_SSL)"=="true" && "$(USE_WINSSL)"=="true" ) \
  483  || ( "$(USE_SSL)"=="true" && "$(USE_MBEDTLS)"=="true" ) \
  484  || ( "$(USE_MBEDTLS)"=="true" && "$(USE_WINSSL)"=="true" )
  485 CFLAGS = $(CFLAGS) /DCURL_WITH_MULTI_SSL
  486 !ENDIF
  487 
  488 LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
  489 CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
  490 
  491 !IFDEF WITH_PREFIX
  492 DIRDIST = $(WITH_PREFIX)
  493 !ELSE
  494 DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
  495 !ENDIF
  496 
  497 #
  498 # curl.exe
  499 #
  500 CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib"
  501 
  502 !IF "$(CFGSET)" != "FALSE"
  503 # A mode was provided, so the library can be built.
  504 #
  505 !include CURL_OBJS.inc
  506 !include LIBCURL_OBJS.inc
  507 
  508 !IF "$(AS_DLL)" == "true"
  509 LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE)
  510 !ELSE
  511 LIB_OBJS = $(LIBCURL_OBJS)
  512 !ENDIF
  513 
  514 EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res
  515 
  516 all : $(TARGET) $(PROGRAM_NAME)
  517 
  518 package: $(TARGET)
  519 	@cd $(DIRDIST)
  520 	@-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1
  521 	@cd $(MAKEDIR)
  522 
  523 $(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DIRDIST)
  524 	@echo Using SSL: $(USE_SSL)
  525 	@echo Using NGHTTP2: $(USE_NGHTTP2)
  526 	@echo Using c-ares: $(USE_CARES)
  527 	@echo Using SSH2: $(USE_SSH2)
  528 	@echo Using ZLIB: $(USE_ZLIB)
  529 	@echo Using IDN:  $(USE_IDN)
  530 	@echo Using IPv6: $(USE_IPV6)
  531 	@echo Using SSPI: $(USE_SSPI)
  532 	@echo Using WinSSL: $(USE_WINSSL)
  533 	@echo CFLAGS:     $(CFLAGS)
  534 	@echo LFLAGS:     $(LFLAGS)
  535 	@echo GenPDB:     $(GEN_PDB)
  536 	@echo Debug:      $(DEBUG)
  537 	@echo Machine:    $(MACHINE)
  538 	$(LNK) $(LIB_OBJS)
  539 	@echo Copying libs...
  540 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL)       $(DIRDIST)\bin\ /y >nul 2<&1
  541 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC)    $(DIRDIST)\lib\ /y >nul 2<&1
  542 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1
  543 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1
  544 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP)       $(DIRDIST)\lib\ /y >nul 2<&1
  545 	@if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1
  546 	@-copy $(LIB_DIROBJ)\*.exp                 $(DIRDIST)\lib /y >nul 2<&1
  547 	@-copy $(LIB_DIROBJ)\*.pdb                 $(DIRDIST)\lib /y >nul 2<&1
  548 	@-copy ..\include\curl\*.h   $(DIRDIST)\include\curl\ /y  >nul 2<&1
  549 
  550 $(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST)
  551 
  552 $(DIRDIST):
  553 	@if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin
  554 	@if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include
  555 	@if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl
  556 	@if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib
  557 
  558 $(LIB_DIROBJ):
  559 	@if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ)
  560 	@if not exist "$(LIB_DIROBJ)\vauth" mkdir $(LIB_DIROBJ)\vauth
  561 	@if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
  562 	@if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic
  563 
  564 $(CURL_DIROBJ):
  565 	@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
  566 # we need a lib dir for the portability functions from libcurl
  567 # we use the .c directly here
  568 	@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib
  569 
  570 .SUFFIXES: .c .obj .res
  571 
  572 {$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj:
  573 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
  574 
  575 {$(LIBCURL_SRC_DIR)\vauth\}.c{$(LIB_DIROBJ)\vauth\}.obj:
  576 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
  577 
  578 {$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj:
  579 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
  580 
  581 {$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj:
  582 	$(CURL_CC) $(CFLAGS) /Fo"$@"  $<
  583 
  584 $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
  585 	$(RC) $(RC_FLAGS)
  586 
  587 #
  588 # curl.exe
  589 #
  590 
  591 
  592 !IF "$(MODE)"=="static"
  593 !IF "$(DEBUG)"=="yes"
  594 CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG)
  595 !ELSE
  596 CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
  597 !ENDIF
  598 !ELSEIF "$(MODE)"=="dll"
  599 !IF "$(DEBUG)"=="yes"
  600 CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG)
  601 !ELSE
  602 CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
  603 !ENDIF
  604 !ENDIF
  605 
  606 CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \
  607  $(CURL_DIROBJ)\nonblock.obj \
  608  $(CURL_DIROBJ)\strtoofft.obj \
  609  $(CURL_DIROBJ)\warnless.obj \
  610  $(CURL_DIROBJ)\curl_ctype.obj
  611  
  612 $(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
  613 	$(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
  614 	$(MANIFESTTOOL)
  615 
  616 {$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj:
  617 	$(CURL_CC) $(CURL_CFLAGS) /Fo"$@"  $<
  618 
  619 $(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c
  620 	$(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c
  621 $(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c
  622 	$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c
  623 $(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c
  624 	$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c
  625 $(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c
  626 	$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c
  627 $(CURL_DIROBJ)\curl_ctype.obj: ../lib/curl_ctype.c
  628 	$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_ctype.c
  629 $(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc
  630 	rc $(CURL_RC_FLAGS)
  631 
  632 !ENDIF  # End of case where a config was provided.
  633 
  634 clean:
  635 	@-erase /s *.dll 2> NUL
  636 	@-erase /s *.exp 2> NUL
  637 	@-erase /s *.idb 2> NUL
  638 	@-erase /s *.lib 2> NUL
  639 	@-erase /s *.obj 2> NUL
  640 	@-erase /s *.pch 2> NUL
  641 	@-erase /s *.pdb 2> NUL
  642 	@-erase /s *.res 2> NUL
  643 	@if exist $(LIB_DIROBJ) rd /s/q $(LIB_DIROBJ)
  644 	@if exist $(CURL_DIROBJ)rd /s/q $(CURL_DIROBJ)
  645 	@if exist $(DIRDIST) rd /s/q $(DIRDIST)