2012-06-15 01:19:18 +08:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2023-01-02 20:51:48 +08:00
|
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2012-06-15 01:19:18 +08:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
2012-06-15 01:19:18 +08:00
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
#
|
2012-06-15 01:19:18 +08:00
|
|
|
#***************************************************************************
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
#
|
2020-11-20 06:20:18 +08:00
|
|
|
# Makefile for building libcurl with MSVC
|
2012-06-15 01:19:18 +08:00
|
|
|
#
|
2020-11-20 06:20:18 +08:00
|
|
|
# Usage: see README.md
|
2012-06-15 01:19:18 +08:00
|
|
|
#
|
|
|
|
##############################################################
|
|
|
|
|
|
|
|
CFGSET=FALSE
|
|
|
|
WINBUILD_DIR=`cd`
|
2018-02-24 04:17:09 +08:00
|
|
|
|
|
|
|
# Utilities.
|
|
|
|
# If a path is required that contains characters such as space, quote the path.
|
|
|
|
MT = mt.exe
|
|
|
|
RC = rc.exe
|
2012-06-15 01:19:18 +08:00
|
|
|
ZIP = zip.exe
|
|
|
|
|
2016-08-10 03:27:36 +08:00
|
|
|
# Allow changing C compiler via environment variable CC (default cl.exe)
|
|
|
|
# This command macro is not set by default: https://msdn.microsoft.com/en-us/library/ms933742.aspx
|
|
|
|
!If "$(CC)" == ""
|
|
|
|
CC = cl.exe
|
|
|
|
!Endif
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(VC)"=="6"
|
2016-08-10 03:27:36 +08:00
|
|
|
CC_NODEBUG = $(CC) /O2 /DNDEBUG
|
|
|
|
CC_DEBUG = $(CC) /Od /Gm /Zi /D_DEBUG /GZ
|
2019-11-30 16:29:36 +08:00
|
|
|
CFLAGS = /I. /I../lib /I../include /nologo /W4 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
|
2012-06-15 01:19:18 +08:00
|
|
|
!ELSE
|
2016-08-10 03:27:36 +08:00
|
|
|
CC_NODEBUG = $(CC) /O2 /DNDEBUG
|
2017-07-09 00:25:22 +08:00
|
|
|
CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
|
2019-11-30 16:29:36 +08:00
|
|
|
CFLAGS = /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
LFLAGS = /nologo /machine:$(MACHINE)
|
|
|
|
LNKDLL = link.exe /DLL
|
2018-04-09 17:19:51 +08:00
|
|
|
# Use lib.exe instead of link.exe as link.exe /lib has the following bad habits:
|
|
|
|
# - optimizing options like /opt:ref raises warnings (at least in Visual Studio 2015)
|
2020-11-20 06:20:18 +08:00
|
|
|
# - all (including Windows) dependencies are aggregated (as static parts)
|
2018-04-09 17:19:51 +08:00
|
|
|
# - link.exe /lib is not documented (anymore) at MSDN
|
|
|
|
# Instead of id: just create an archive, that contains all objects
|
|
|
|
LNKLIB = lib.exe
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
CFLAGS_PDB = /Zi
|
2018-01-30 00:41:11 +08:00
|
|
|
LFLAGS_PDB = /incremental:no /opt:ref,icf /DEBUG
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB
|
|
|
|
|
schannel: add support for CURLOPT_CAINFO
- Move verify_certificate functionality in schannel.c into a new
file called schannel_verify.c. Additionally, some structure defintions
from schannel.c have been moved to schannel.h to allow them to be
used in schannel_verify.c.
- Make verify_certificate functionality for Schannel available on
all versions of Windows instead of just Windows CE. verify_certificate
will be invoked on Windows CE or when the user specifies
CURLOPT_CAINFO and CURLOPT_SSL_VERIFYPEER.
- In verify_certificate, create a custom certificate chain engine that
exclusively trusts the certificate store backed by the CURLOPT_CAINFO
file.
- doc updates of --cacert/CAINFO support for schannel
- Use CERT_NAME_SEARCH_ALL_NAMES_FLAG when invoking CertGetNameString
when available. This implements a TODO in schannel.c to improve
handling of multiple SANs in a certificate. In particular, all SANs
will now be searched instead of just the first name.
- Update tool_operate.c to not search for the curl-ca-bundle.crt file
when using Schannel to maintain backward compatibility. Previously,
any curl-ca-bundle.crt file found in that search would have been
ignored by Schannel. But, with CAINFO support, the file found by
that search would have been used as the certificate store and
could cause issues for any users that have curl-ca-bundle.crt in
the search path.
- Update url.c to not set the build time CURL_CA_BUNDLE if the selected
SSL backend is Schannel. We allow setting CA location for schannel
only when explicitly specified by the user via CURLOPT_CAINFO /
--cacert.
- Add new test cases 3000 and 3001. These test cases check that the first
and last SAN, respectively, matches the connection hostname. New test
certificates have been added for these cases. For 3000, the certificate
prefix is Server-localhost-firstSAN and for 3001, the certificate
prefix is Server-localhost-secondSAN.
- Remove TODO 15.2 (Add support for custom server certificate
validation), this commit addresses it.
Closes https://github.com/curl/curl/pull/1325
2017-03-11 04:27:30 +08:00
|
|
|
WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib
|
2012-11-15 06:19:32 +08:00
|
|
|
|
|
|
|
BASE_NAME = libcurl
|
|
|
|
BASE_NAME_DEBUG = $(BASE_NAME)_debug
|
|
|
|
BASE_NAME_STATIC = $(BASE_NAME)_a
|
|
|
|
BASE_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC)_debug
|
|
|
|
|
|
|
|
LIB_NAME_STATIC = $(BASE_NAME_STATIC).lib
|
|
|
|
LIB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).lib
|
|
|
|
LIB_NAME_DLL = $(BASE_NAME).dll
|
|
|
|
LIB_NAME_IMP = $(BASE_NAME).lib
|
|
|
|
LIB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).dll
|
|
|
|
LIB_NAME_IMP_DEBUG = $(BASE_NAME_DEBUG).lib
|
|
|
|
|
|
|
|
PDB_NAME_STATIC = $(BASE_NAME_STATIC).pdb
|
|
|
|
PDB_NAME_STATIC_DEBUG = $(BASE_NAME_STATIC_DEBUG).pdb
|
|
|
|
PDB_NAME_DLL = $(BASE_NAME).pdb
|
|
|
|
PDB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).pdb
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
# CURL Command section
|
2018-04-09 17:19:51 +08:00
|
|
|
PROGRAM_NAME = curl.exe
|
|
|
|
CURL_CFLAGS = /I../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c
|
|
|
|
CURL_LFLAGS = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS)
|
2012-06-15 01:19:18 +08:00
|
|
|
CURL_RESFLAGS = /i../include
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
## Nothing more to do below this line!
|
|
|
|
LIBCURL_SRC_DIR = ..\lib
|
|
|
|
CURL_SRC_DIR = ..\src
|
|
|
|
|
|
|
|
!IFNDEF WITH_DEVEL
|
2018-04-09 17:19:51 +08:00
|
|
|
WITH_DEVEL = ../../deps
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
2018-04-09 17:19:51 +08:00
|
|
|
DEVEL_INCLUDE= $(WITH_DEVEL)/include
|
|
|
|
DEVEL_LIB = $(WITH_DEVEL)/lib
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
!IF EXISTS("$(DEVEL_INCLUDE)")
|
|
|
|
CFLAGS = $(CFLAGS) /I"$(DEVEL_INCLUDE)"
|
|
|
|
!ENDIF
|
|
|
|
!IF EXISTS("$(DEVEL_LIB)")
|
|
|
|
LFLAGS = $(LFLAGS) "/LIBPATH:$(DEVEL_LIB)"
|
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
!IFDEF SSL_PATH
|
|
|
|
SSL_INC_DIR = $(SSL_PATH)\include
|
|
|
|
SSL_LIB_DIR = $(SSL_PATH)\lib
|
|
|
|
SSL_LFLAGS = $(SSL_LFLAGS) "/LIBPATH:$(SSL_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
SSL_INC_DIR=$(DEVEL_INCLUDE)\openssl
|
|
|
|
SSL_LIB_DIR=$(DEVEL_LIB)
|
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
!IF "$(WITH_SSL)"=="dll" || "$(WITH_SSL)"=="static"
|
|
|
|
!IF EXISTS("$(SSL_LIB_DIR)\libssl.lib")
|
2017-03-11 00:04:45 +08:00
|
|
|
SSL_LIBS = libssl.lib libcrypto.lib
|
|
|
|
!ELSE
|
2012-06-15 01:19:18 +08:00
|
|
|
SSL_LIBS = libeay32.lib ssleay32.lib
|
2017-03-11 00:04:45 +08:00
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
USE_SSL = true
|
2018-04-09 17:19:51 +08:00
|
|
|
SSL = $(WITH_SSL)
|
|
|
|
!IF "$(WITH_SSL)"=="static"
|
|
|
|
WIN_LIBS = $(WIN_LIBS) gdi32.lib user32.lib crypt32.lib
|
2017-03-11 00:04:45 +08:00
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IFDEF USE_SSL
|
2018-04-09 17:19:51 +08:00
|
|
|
SSL_CFLAGS = /DUSE_OPENSSL /I"$(SSL_INC_DIR)"
|
|
|
|
!IF EXISTS("$(SSL_INC_DIR)\is_boringssl.h")
|
2017-06-24 17:55:21 +08:00
|
|
|
SSL_CFLAGS = $(SSL_CFLAGS) /DHAVE_BORINGSSL
|
|
|
|
!ENDIF
|
2018-07-25 17:00:15 +08:00
|
|
|
!IF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="false"
|
|
|
|
SSL_CFLAGS = $(SSL_CFLAGS) /DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
|
|
|
|
!ENDIF
|
2016-11-25 13:06:14 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
|
|
|
|
!IFDEF NGHTTP2_PATH
|
|
|
|
NGHTTP2_INC_DIR = $(NGHTTP2_PATH)\include
|
|
|
|
NGHTTP2_LIB_DIR = $(NGHTTP2_PATH)\lib
|
|
|
|
NGHTTP2_LFLAGS = $(NGHTTP2_LFLAGS) "/LIBPATH:$(NGHTTP2_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
NGHTTP2_INC_DIR = $(DEVEL_INCLUDE)
|
|
|
|
NGHTTP2_LIB_DIR = $(DEVEL_LIB)
|
|
|
|
!ENDIF
|
|
|
|
|
2017-03-10 19:59:36 +08:00
|
|
|
!IF "$(WITH_NGHTTP2)"=="dll"
|
2018-04-09 17:19:51 +08:00
|
|
|
NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /I"$(NGHTTP2_INC_DIR)"
|
2017-03-10 19:59:36 +08:00
|
|
|
NGHTTP2_LIBS = nghttp2.lib
|
|
|
|
!ELSEIF "$(WITH_NGHTTP2)"=="static"
|
2018-04-09 17:19:51 +08:00
|
|
|
NGHTTP2_CFLAGS = /DUSE_NGHTTP2 /DNGHTTP2_STATICLIB /I"$(NGHTTP2_INC_DIR)"
|
2021-07-20 01:59:06 +08:00
|
|
|
!IF EXISTS("$(NGHTTP2_LIB_DIR)\nghttp2_static.lib")
|
2017-03-10 19:59:36 +08:00
|
|
|
NGHTTP2_LIBS = nghttp2_static.lib
|
2021-07-20 01:59:06 +08:00
|
|
|
!ELSE
|
|
|
|
NGHTTP2_LIBS = nghttp2.lib
|
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2022-04-11 00:21:37 +08:00
|
|
|
!IFDEF MSH3_PATH
|
|
|
|
MSH3_INC_DIR = $(MSH3_PATH)\include
|
|
|
|
MSH3_LIB_DIR = $(MSH3_PATH)\lib
|
|
|
|
MSH3_LFLAGS = $(MSH3_LFLAGS) "/LIBPATH:$(MSH3_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
MSH3_INC_DIR = $(DEVEL_INCLUDE)
|
|
|
|
MSH3_LIB_DIR = $(DEVEL_LIB)
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(WITH_MSH3)"=="dll"
|
|
|
|
MSH3_CFLAGS = /DUSE_MSH3 /I"$(MSH3_INC_DIR)"
|
|
|
|
MSH3_LIBS = msh3.lib
|
|
|
|
!ELSEIF "$(WITH_MSH3)"=="static"
|
|
|
|
MSH3_CFLAGS = /DUSE_MSH3 /DMSH3_STATICLIB /I"$(MSH3_INC_DIR)"
|
|
|
|
!IF EXISTS("$(NGHTTP2_LIB_DIR)\msh3_static.lib")
|
|
|
|
MSH3_LIBS = msh3_static.lib
|
|
|
|
!ELSE
|
|
|
|
MSH3_LIBS = msh3.lib
|
|
|
|
!ENDIF
|
|
|
|
!ENDIF
|
2018-04-09 17:19:51 +08:00
|
|
|
|
|
|
|
!IFDEF MBEDTLS_PATH
|
|
|
|
MBEDTLS_INC_DIR = $(MBEDTLS_PATH)\include
|
|
|
|
MBEDTLS_LIB_DIR = $(MBEDTLS_PATH)\lib
|
|
|
|
MBEDTLS_LFLAGS = $(MBEDTLS_LFLAGS) "/LIBPATH:$(MBEDTLS_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
MBEDTLS_INC_DIR = $(DEVEL_INCLUDE)
|
|
|
|
MBEDTLS_LIB_DIR = $(DEVEL_LIB)
|
|
|
|
!ENDIF
|
|
|
|
|
2016-04-22 05:23:49 +08:00
|
|
|
!IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
|
|
|
|
USE_MBEDTLS = true
|
|
|
|
MBEDTLS = $(WITH_MBEDTLS)
|
2018-04-09 17:19:51 +08:00
|
|
|
MBEDTLS_CFLAGS = /DUSE_MBEDTLS /I"$(MBEDTLS_INC_DIR)"
|
2016-04-22 05:23:49 +08:00
|
|
|
MBEDTLS_LIBS = mbedtls.lib mbedcrypto.lib mbedx509.lib
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
!IFDEF CARES_PATH
|
|
|
|
CARES_INC_DIR = $(CARES_PATH)\include
|
|
|
|
CARES_LIB_DIR = $(CARES_PATH)\lib
|
|
|
|
CARES_LFLAGS = $(CARES_LFLAGS) "/LIBPATH:$(CARES_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
CARES_INC_DIR = $(DEVEL_INCLUDE)/cares
|
|
|
|
CARES_LIB_DIR = $(DEVEL_LIB)
|
|
|
|
!ENDIF
|
|
|
|
|
2014-12-30 02:57:21 +08:00
|
|
|
!IF "$(WITH_CARES)"=="dll"
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
CARES_LIBS = caresd.lib
|
|
|
|
!ELSE
|
|
|
|
CARES_LIBS = cares.lib
|
|
|
|
!ENDIF
|
|
|
|
USE_CARES = true
|
|
|
|
CARES = dll
|
|
|
|
!ELSEIF "$(WITH_CARES)"=="static"
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
CARES_LIBS = libcaresd.lib
|
|
|
|
!ELSE
|
|
|
|
CARES_LIBS = libcares.lib
|
|
|
|
!ENDIF
|
|
|
|
USE_CARES = true
|
|
|
|
CARES = static
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IFDEF USE_CARES
|
2018-04-09 17:19:51 +08:00
|
|
|
CARES_CFLAGS = /DUSE_ARES /I"$(CARES_INC_DIR)"
|
2019-12-09 19:00:20 +08:00
|
|
|
!IF "$(CARES)"=="static"
|
|
|
|
CARES_CFLAGS = $(CARES_CFLAGS) /DCARES_STATICLIB
|
|
|
|
!ENDIF
|
2018-04-09 17:19:51 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
|
|
|
!IFDEF ZLIB_PATH
|
|
|
|
ZLIB_INC_DIR = $(ZLIB_PATH)\include
|
|
|
|
ZLIB_LIB_DIR = $(ZLIB_PATH)\lib
|
|
|
|
ZLIB_LFLAGS = $(ZLIB_LFLAGS) "/LIBPATH:$(ZLIB_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
ZLIB_INC_DIR = $(DEVEL_INCLUDE)
|
|
|
|
ZLIB_LIB_DIR = $(DEVEL_LIB)
|
2014-12-30 02:57:21 +08:00
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2020-11-20 06:20:18 +08:00
|
|
|
# Depending on how zlib is built the libraries have different names, we
|
|
|
|
# try to handle them all.
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(WITH_ZLIB)"=="dll"
|
2018-04-09 17:19:51 +08:00
|
|
|
!IF EXISTS("$(ZLIB_LIB_DIR)\zlibwapi.lib")
|
2018-03-03 06:13:42 +08:00
|
|
|
ZLIB_LIBS = zlibwapi.lib
|
2019-01-11 20:06:37 +08:00
|
|
|
ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI
|
2018-04-09 17:19:51 +08:00
|
|
|
!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zdll.lib")
|
2018-03-03 06:13:42 +08:00
|
|
|
ZLIB_LIBS = zdll.lib
|
|
|
|
!ELSE
|
2012-06-15 01:19:18 +08:00
|
|
|
ZLIB_LIBS = zlib.lib
|
2018-03-03 06:13:42 +08:00
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
USE_ZLIB = true
|
|
|
|
ZLIB = dll
|
|
|
|
!ELSEIF "$(WITH_ZLIB)"=="static"
|
2018-04-09 17:19:51 +08:00
|
|
|
!IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib")
|
2018-03-03 06:13:42 +08:00
|
|
|
ZLIB_LIBS = zlibstat.lib
|
2019-01-11 20:06:37 +08:00
|
|
|
ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI
|
2018-04-09 17:19:51 +08:00
|
|
|
!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib")
|
2018-03-03 06:13:42 +08:00
|
|
|
ZLIB_LIBS = zlib.lib
|
|
|
|
!ELSE
|
2012-06-15 01:19:18 +08:00
|
|
|
ZLIB_LIBS = zlib_a.lib
|
2018-03-03 06:13:42 +08:00
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
USE_ZLIB = true
|
|
|
|
ZLIB = static
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IFDEF USE_ZLIB
|
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:
- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.
Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.
Also delete stray `HAVE_ZLIB` defines.
There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.
- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.
Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.
Also delete stray `HAVE_LIBSSH2` defines.
- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.
Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.
- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.
Reviewed-by: Daniel Stenberg
Closes #9652
2022-10-06 23:30:13 +08:00
|
|
|
ZLIB_CFLAGS = /DHAVE_LIBZ $(ADDITIONAL_ZLIB_CFLAGS) /I"$(ZLIB_INC_DIR)"
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
!IFDEF SSH2_PATH
|
|
|
|
SSH2_INC_DIR= $(SSH2_PATH)\include
|
|
|
|
SSH2_LIB_DIR= $(SSH2_PATH)\lib
|
|
|
|
SSH2_LFLAGS = $(SSH2_LFLAGS) "/LIBPATH:$(SSH2_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
SSH2_LIB_DIR= $(DEVEL_LIB)
|
|
|
|
SSH2_INC_DIR= $(DEVEL_INCLUDE)/libssh2
|
|
|
|
!ENDIF
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(WITH_SSH2)"=="dll"
|
|
|
|
SSH2_LIBS = libssh2.lib
|
|
|
|
USE_SSH2 = true
|
|
|
|
SSH2 = dll
|
|
|
|
!ELSEIF "$(WITH_SSH2)"=="static"
|
2018-04-09 17:19:51 +08:00
|
|
|
# libssh2 NMakefile on Windows at default creates a static library without _a suffix
|
|
|
|
!IF EXISTS("$(SSH2_LIB_DIR)\libssh2.lib")
|
|
|
|
SSH2_LIBS = libssh2.lib
|
|
|
|
!ELSE
|
|
|
|
SSH2_LIBS = libssh2_a.lib
|
|
|
|
!ENDIF
|
|
|
|
WIN_LIBS = $(WIN_LIBS) user32.lib
|
2012-06-15 01:19:18 +08:00
|
|
|
USE_SSH2 = true
|
|
|
|
SSH2 = static
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IFDEF USE_SSH2
|
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:
- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.
Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.
Also delete stray `HAVE_ZLIB` defines.
There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.
- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.
Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.
Also delete stray `HAVE_LIBSSH2` defines.
- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.
Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.
- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.
Reviewed-by: Daniel Stenberg
Closes #9652
2022-10-06 23:30:13 +08:00
|
|
|
SSH2_CFLAGS = /DUSE_LIBSSH2
|
2022-09-19 18:43:41 +08:00
|
|
|
SSH2_CFLAGS = $(SSH2_CFLAGS) /I"$(SSH2_INC_DIR)"
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2022-02-26 02:07:00 +08:00
|
|
|
!IFDEF SSH_PATH
|
|
|
|
SSH_INC_DIR= $(SSH_PATH)\include
|
|
|
|
SSH_LIB_DIR= $(SSH_PATH)\lib
|
|
|
|
SSH_LFLAGS = $(SSH_LFLAGS) "/LIBPATH:$(SSH_LIB_DIR)"
|
|
|
|
!ELSE
|
|
|
|
SSH_LIB_DIR= $(DEVEL_LIB)
|
|
|
|
SSH_INC_DIR= $(DEVEL_INCLUDE)
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(WITH_SSH)"=="dll" || "$(WITH_SSH)"=="static"
|
|
|
|
SSH_LIBS = ssh.lib
|
|
|
|
USE_SSH = true
|
|
|
|
SSH = $(WITH_SSH)
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IFDEF USE_SSH
|
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in
variations or with extra ones, but this wasn't the case here. These were
duplicate/parallel macros that we had to keep in sync with each other
for a working build. This patch leaves a single macro for each of these
dependencies:
- Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`.
Also delete CMake logic making sure these two were in sync, along with
a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`.
Also delete stray `HAVE_ZLIB` defines.
There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch
retains it for compatibility and deprecates it.
- Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`.
Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from
`winbuild/MakefileBuild.vc`, these have a role when building libssh2
itself. And `CURL_USE_LIBSSH`, which had no use at all.
Also delete stray `HAVE_LIBSSH2` defines.
- Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`.
Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from
`winbuild/MakefileBuild.vc`, these were the result of copy-pasting the
libssh2 line, and were not having any use.
- Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`.
Reviewed-by: Daniel Stenberg
Closes #9652
2022-10-06 23:30:13 +08:00
|
|
|
SSH_CFLAGS = /DUSE_LIBSSH
|
2022-09-19 18:43:41 +08:00
|
|
|
SSH_CFLAGS = $(SSH_CFLAGS) /I"$(SSH_INC_DIR)"
|
2022-02-26 02:07:00 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2012-09-11 03:56:39 +08:00
|
|
|
!IFNDEF USE_IDN
|
|
|
|
USE_IDN = true
|
|
|
|
!ELSEIF "$(USE_IDN)"=="yes"
|
|
|
|
USE_IDN = true
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2012-09-11 03:56:39 +08:00
|
|
|
!IF "$(USE_IDN)"=="true"
|
2022-10-26 17:43:50 +08:00
|
|
|
IDN_CFLAGS = $(IDN_CFLAGS) /DUSE_WIN32_IDN
|
2012-11-15 06:19:32 +08:00
|
|
|
WIN_LIBS = $(WIN_LIBS) Normaliz.lib
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
|
|
|
!IFNDEF USE_IPV6
|
|
|
|
USE_IPV6 = true
|
|
|
|
!ELSEIF "$(USE_IPV6)"=="yes"
|
|
|
|
USE_IPV6 = true
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(USE_IPV6)"=="true"
|
2012-07-05 14:39:40 +08:00
|
|
|
IPV6_CFLAGS = $(IPV6_CFLAGS) /DUSE_IPV6
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2012-09-11 03:56:39 +08:00
|
|
|
!IFNDEF USE_SSPI
|
|
|
|
USE_SSPI = true
|
|
|
|
!ELSEIF "$(USE_SSPI)"=="yes"
|
|
|
|
USE_SSPI = true
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2012-09-11 03:56:39 +08:00
|
|
|
!IF "$(USE_SSPI)"=="true"
|
|
|
|
SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_WINDOWS_SSPI
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2020-08-07 23:11:52 +08:00
|
|
|
!IFNDEF USE_SCHANNEL
|
2012-07-05 14:53:02 +08:00
|
|
|
!IF "$(USE_SSL)"=="true"
|
2020-08-07 23:11:52 +08:00
|
|
|
USE_SCHANNEL = false
|
2012-07-05 14:53:02 +08:00
|
|
|
!ELSE
|
2020-08-07 23:11:52 +08:00
|
|
|
USE_SCHANNEL = $(USE_SSPI)
|
2012-07-05 14:53:02 +08:00
|
|
|
!ENDIF
|
2020-08-07 23:11:52 +08:00
|
|
|
!ELSEIF "$(USE_SCHANNEL)"=="yes"
|
|
|
|
USE_SCHANNEL = true
|
2012-07-05 14:53:02 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2012-11-15 06:19:32 +08:00
|
|
|
|
2020-08-07 23:11:52 +08:00
|
|
|
!IF "$(USE_SCHANNEL)"=="true"
|
2012-07-05 14:53:02 +08:00
|
|
|
!IF "$(USE_SSPI)"!="true"
|
2020-08-07 23:11:52 +08:00
|
|
|
!ERROR cannot build with Schannel without SSPI
|
2012-07-05 14:53:02 +08:00
|
|
|
!ENDIF
|
|
|
|
SSPI_CFLAGS = $(SSPI_CFLAGS) /DUSE_SCHANNEL
|
2016-06-01 14:48:30 +08:00
|
|
|
WIN_LIBS = $(WIN_LIBS) Crypt32.lib
|
2012-07-05 14:53:02 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(GEN_PDB)"=="yes"
|
2012-07-05 14:39:40 +08:00
|
|
|
GEN_PDB = true
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
|
2016-07-21 13:37:29 +08:00
|
|
|
!IFDEF EMBED_MANIFEST
|
2018-02-24 04:17:09 +08:00
|
|
|
MANIFESTTOOL = $(MT) -manifest $(DIRDIST)\bin\$(PROGRAM_NAME).manifest -outputresource:$(DIRDIST)\bin\$(PROGRAM_NAME);1
|
2018-05-30 20:08:26 +08:00
|
|
|
!ELSE
|
|
|
|
CURL_RC_FLAGS = $(CURL_RC_FLAGS) /dCURL_EMBED_MANIFEST
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
# Runtime library configuration
|
2012-07-05 14:39:40 +08:00
|
|
|
!IF "$(RTLIBCFG)"=="static"
|
|
|
|
RTLIB = /MT
|
2012-06-15 01:19:18 +08:00
|
|
|
RTLIB_DEBUG = /MTd
|
|
|
|
!ELSE
|
2012-07-05 14:39:40 +08:00
|
|
|
RTLIB = /MD
|
2012-06-15 01:19:18 +08:00
|
|
|
RTLIB_DEBUG = /MDd
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(MODE)"=="static"
|
|
|
|
TARGET = $(LIB_NAME_STATIC)
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
|
|
|
|
AS_DLL = false
|
2012-07-05 14:39:40 +08:00
|
|
|
CFGSET = true
|
2012-06-15 01:19:18 +08:00
|
|
|
!ELSEIF "$(MODE)"=="dll"
|
|
|
|
TARGET = $(LIB_NAME_DLL)
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
|
|
|
|
AS_DLL = true
|
2012-07-05 14:39:40 +08:00
|
|
|
CFGSET = true
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(CFGSET)" == "FALSE"
|
|
|
|
!ERROR please choose a valid mode
|
|
|
|
!ENDIF
|
|
|
|
|
2012-11-15 06:19:32 +08:00
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
# CURL_XX macros are for the curl.exe command
|
|
|
|
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
|
2016-08-09 14:29:59 +08:00
|
|
|
CURL_CC = $(CC_DEBUG) $(RTLIB_DEBUG)
|
2019-09-23 04:03:18 +08:00
|
|
|
CURL_RC_FLAGS = $(CURL_RC_FLAGS) /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc
|
2012-06-15 01:19:18 +08:00
|
|
|
!ELSE
|
|
|
|
RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
|
2016-08-09 14:29:59 +08:00
|
|
|
CURL_CC = $(CC_NODEBUG) $(RTLIB)
|
2019-09-23 04:03:18 +08:00
|
|
|
CURL_RC_FLAGS = $(CURL_RC_FLAGS) /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(AS_DLL)" == "true"
|
|
|
|
|
2018-04-09 17:19:51 +08:00
|
|
|
LNK = $(LNKDLL) $(LFLAGS) $(WIN_LIBS) /out:$(LIB_DIROBJ)\$(TARGET)
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
TARGET = $(LIB_NAME_DLL_DEBUG)
|
|
|
|
LNK = $(LNK) /DEBUG /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
|
2012-11-15 06:19:32 +08:00
|
|
|
PDB = $(PDB_NAME_DLL_DEBUG)
|
2012-06-15 01:19:18 +08:00
|
|
|
CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG)
|
|
|
|
!ELSE
|
|
|
|
TARGET = $(LIB_NAME_DLL)
|
|
|
|
LNK = $(LNK) /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
|
2012-11-15 06:19:32 +08:00
|
|
|
PDB = $(PDB_NAME_DLL)
|
2012-06-15 01:19:18 +08:00
|
|
|
CURL_LIBS = /IMPLIB:$(LIB_DIROBJ)\$(LIB_NAME_IMP)
|
|
|
|
!ENDIF
|
2012-11-15 06:19:32 +08:00
|
|
|
RESOURCE = $(LIB_DIROBJ)\libcurl.res
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
# AS_DLL
|
|
|
|
!ELSE
|
|
|
|
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
TARGET = $(LIB_NAME_STATIC_DEBUG)
|
2012-11-15 06:19:32 +08:00
|
|
|
PDB = $(PDB_NAME_STATIC_DEBUG)
|
2012-06-15 01:19:18 +08:00
|
|
|
!ELSE
|
|
|
|
TARGET = $(LIB_NAME_STATIC)
|
2012-11-15 06:19:32 +08:00
|
|
|
PDB = $(PDB_NAME_STATIC)
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
2018-04-09 17:19:51 +08:00
|
|
|
LNK = $(LNKLIB) /out:$(LIB_DIROBJ)\$(TARGET)
|
2016-08-09 14:29:59 +08:00
|
|
|
CURL_CC = $(CURL_CC) $(CFLAGS_LIBCURL_STATIC)
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
# AS_DLL
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(USE_SSL)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(SSL_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2016-04-22 05:23:49 +08:00
|
|
|
!IF "$(USE_MBEDTLS)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(MBEDTLS_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(MBEDTLS_LFLAGS) $(MBEDTLS_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2014-12-30 02:57:21 +08:00
|
|
|
!IF "$(USE_CARES)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(CARES_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(CARES_LFLAGS) $(CARES_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(USE_ZLIB)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS) $(ZLIB_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(USE_SSH2)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(SSH2_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(SSH2_LFLAGS) $(SSH2_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2022-02-26 02:07:00 +08:00
|
|
|
!IF "$(USE_SSH)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(SSH_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(SSH_LFLAGS) $(SSH_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2012-11-15 06:19:32 +08:00
|
|
|
!IF "$(USE_IDN)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(IDN_CFLAGS)
|
|
|
|
!ENDIF
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(USE_IPV6)"=="true"
|
2012-07-05 14:39:40 +08:00
|
|
|
CFLAGS = $(CFLAGS) $(IPV6_CFLAGS)
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(USE_SSPI)"=="true"
|
2012-07-05 14:39:40 +08:00
|
|
|
CFLAGS = $(CFLAGS) $(SSPI_CFLAGS)
|
2012-06-15 01:19:18 +08:00
|
|
|
!ENDIF
|
|
|
|
|
2017-03-10 19:59:36 +08:00
|
|
|
!IF "$(USE_NGHTTP2)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(NGHTTP2_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(NGHTTP2_LFLAGS) $(NGHTTP2_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2022-04-11 00:21:37 +08:00
|
|
|
!IF "$(USE_MSH3)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) $(MSH3_CFLAGS)
|
|
|
|
LFLAGS = $(LFLAGS) $(MSH3_LFLAGS) $(MSH3_LIBS)
|
|
|
|
!ENDIF
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
!IF "$(GEN_PDB)"=="true"
|
2012-11-15 06:19:32 +08:00
|
|
|
CFLAGS = $(CFLAGS) $(CFLAGS_PDB) /Fd"$(LIB_DIROBJ)\$(PDB)"
|
2012-06-15 01:19:18 +08:00
|
|
|
LFLAGS = $(LFLAGS) $(LFLAGS_PDB)
|
|
|
|
!ENDIF
|
|
|
|
|
2020-08-07 23:11:52 +08:00
|
|
|
!IF ( "$(USE_SSL)"=="true" && "$(USE_SCHANNEL)"=="true" ) \
|
2019-04-13 05:41:13 +08:00
|
|
|
|| ( "$(USE_SSL)"=="true" && "$(USE_MBEDTLS)"=="true" ) \
|
2020-08-07 23:11:52 +08:00
|
|
|
|| ( "$(USE_MBEDTLS)"=="true" && "$(USE_SCHANNEL)"=="true" )
|
2019-04-13 05:41:13 +08:00
|
|
|
CFLAGS = $(CFLAGS) /DCURL_WITH_MULTI_SSL
|
|
|
|
!ENDIF
|
|
|
|
|
2019-09-09 23:06:15 +08:00
|
|
|
!IF "$(USE_UNICODE)"=="true"
|
|
|
|
CFLAGS = $(CFLAGS) /DUNICODE /D_UNICODE
|
|
|
|
!ENDIF
|
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
LIB_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
|
2019-09-11 18:56:22 +08:00
|
|
|
CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
|
|
|
|
|
|
|
|
!IFDEF WITH_PREFIX
|
|
|
|
DIRDIST = $(WITH_PREFIX)
|
|
|
|
!ELSE
|
|
|
|
DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
|
|
|
|
!ENDIF
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# curl.exe
|
|
|
|
#
|
|
|
|
CURL_LINK = link.exe /incremental:no /libpath:"$(DIRDIST)\lib"
|
|
|
|
|
2018-04-04 17:32:19 +08:00
|
|
|
!IF "$(CFGSET)" != "FALSE"
|
2012-06-15 01:19:18 +08:00
|
|
|
# A mode was provided, so the library can be built.
|
|
|
|
#
|
|
|
|
!include CURL_OBJS.inc
|
|
|
|
!include LIBCURL_OBJS.inc
|
|
|
|
|
2013-02-05 07:08:01 +08:00
|
|
|
!IF "$(AS_DLL)" == "true"
|
|
|
|
LIB_OBJS = $(LIBCURL_OBJS) $(RESOURCE)
|
|
|
|
!ELSE
|
2012-07-05 14:39:40 +08:00
|
|
|
LIB_OBJS = $(LIBCURL_OBJS)
|
2013-02-05 07:08:01 +08:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
EXE_OBJS = $(CURL_OBJS) $(CURL_DIROBJ)\curl.res
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
all : $(TARGET) $(PROGRAM_NAME)
|
|
|
|
|
|
|
|
package: $(TARGET)
|
|
|
|
@cd $(DIRDIST)
|
|
|
|
@-$(ZIP) -9 -q -r ..\$(CONFIG_NAME_LIB).zip .>nul 2<&1
|
|
|
|
@cd $(MAKEDIR)
|
|
|
|
|
2018-05-25 04:35:38 +08:00
|
|
|
$(TARGET): $(LIB_OBJS) $(LIB_DIROBJ) $(DIRDIST)
|
2012-06-15 01:19:18 +08:00
|
|
|
@echo Using SSL: $(USE_SSL)
|
2016-11-25 13:06:14 +08:00
|
|
|
@echo Using NGHTTP2: $(USE_NGHTTP2)
|
2022-04-11 00:21:37 +08:00
|
|
|
@echo Using MSH3: $(USE_MSH3)
|
2014-12-30 02:57:21 +08:00
|
|
|
@echo Using c-ares: $(USE_CARES)
|
2012-06-15 01:19:18 +08:00
|
|
|
@echo Using SSH2: $(USE_SSH2)
|
2022-02-26 02:07:00 +08:00
|
|
|
@echo Using SSH: $(USE_SSH)
|
2012-06-15 01:19:18 +08:00
|
|
|
@echo Using ZLIB: $(USE_ZLIB)
|
|
|
|
@echo Using IDN: $(USE_IDN)
|
2012-09-11 03:56:39 +08:00
|
|
|
@echo Using IPv6: $(USE_IPV6)
|
|
|
|
@echo Using SSPI: $(USE_SSPI)
|
2020-08-07 23:11:52 +08:00
|
|
|
@echo Using Schannel: $(USE_SCHANNEL)
|
2012-06-15 01:19:18 +08:00
|
|
|
@echo CFLAGS: $(CFLAGS)
|
|
|
|
@echo LFLAGS: $(LFLAGS)
|
|
|
|
@echo GenPDB: $(GEN_PDB)
|
|
|
|
@echo Debug: $(DEBUG)
|
2012-11-15 06:19:32 +08:00
|
|
|
@echo Machine: $(MACHINE)
|
2018-04-09 17:19:51 +08:00
|
|
|
$(LNK) $(LIB_OBJS)
|
2012-06-15 01:19:18 +08:00
|
|
|
@echo Copying libs...
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL) $(DIRDIST)\bin\ /y >nul 2<&1
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC) $(DIRDIST)\lib\ /y >nul 2<&1
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_DLL_DEBUG) $(DIRDIST)\bin\ /y >nul 2<&1
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_STATIC_DEBUG) $(DIRDIST)\lib\ /y >nul 2<&1
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP) $(DIRDIST)\lib\ /y >nul 2<&1
|
|
|
|
@if exist $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) copy $(LIB_DIROBJ)\$(LIB_NAME_IMP_DEBUG) $(DIRDIST)\lib >nul 2<&1
|
|
|
|
@-copy $(LIB_DIROBJ)\*.exp $(DIRDIST)\lib /y >nul 2<&1
|
|
|
|
@-copy $(LIB_DIROBJ)\*.pdb $(DIRDIST)\lib /y >nul 2<&1
|
|
|
|
@-copy ..\include\curl\*.h $(DIRDIST)\include\curl\ /y >nul 2<&1
|
|
|
|
|
|
|
|
$(LIB_OBJS): $(LIB_DIROBJ) $(DIRDIST)
|
|
|
|
|
|
|
|
$(DIRDIST):
|
|
|
|
@if not exist "$(DIRDIST)\bin" mkdir $(DIRDIST)\bin
|
|
|
|
@if not exist "$(DIRDIST)\include" mkdir $(DIRDIST)\include
|
|
|
|
@if not exist "$(DIRDIST)\include\curl" mkdir $(DIRDIST)\include\curl
|
|
|
|
@if not exist "$(DIRDIST)\lib" mkdir $(DIRDIST)\lib
|
|
|
|
|
|
|
|
$(LIB_DIROBJ):
|
|
|
|
@if not exist "$(LIB_DIROBJ)" mkdir $(LIB_DIROBJ)
|
2015-09-12 18:14:14 +08:00
|
|
|
@if not exist "$(LIB_DIROBJ)\vauth" mkdir $(LIB_DIROBJ)\vauth
|
2014-01-08 20:05:48 +08:00
|
|
|
@if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls
|
2019-09-11 18:56:54 +08:00
|
|
|
@if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh
|
2019-07-29 13:49:08 +08:00
|
|
|
@if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
$(CURL_DIROBJ):
|
|
|
|
@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)
|
|
|
|
# we need a lib dir for the portability functions from libcurl
|
|
|
|
# we use the .c directly here
|
|
|
|
@if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ)\lib
|
|
|
|
|
|
|
|
.SUFFIXES: .c .obj .res
|
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(LIBCURL_SRC_DIR)\}.c{$(LIB_DIROBJ)\}.obj::
|
|
|
|
$(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\\" $<
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(LIBCURL_SRC_DIR)\vauth\}.c{$(LIB_DIROBJ)\vauth\}.obj::
|
|
|
|
$(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\vauth\\" $<
|
2015-09-12 18:14:14 +08:00
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(LIBCURL_SRC_DIR)\vtls\}.c{$(LIB_DIROBJ)\vtls\}.obj::
|
|
|
|
$(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\vtls\\" $<
|
2019-09-11 18:56:54 +08:00
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(LIBCURL_SRC_DIR)\vssh\}.c{$(LIB_DIROBJ)\vssh\}.obj::
|
|
|
|
$(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\vssh\\" $<
|
2014-01-08 20:05:48 +08:00
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj::
|
|
|
|
$(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\vquic\\" $<
|
2019-07-29 13:49:08 +08:00
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
$(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc
|
2018-02-24 04:17:09 +08:00
|
|
|
$(RC) $(RC_FLAGS)
|
2012-06-15 01:19:18 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# curl.exe
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
!IF "$(MODE)"=="static"
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC_DEBUG)
|
|
|
|
!ELSE
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_STATIC)
|
|
|
|
!ENDIF
|
|
|
|
!ELSEIF "$(MODE)"=="dll"
|
|
|
|
!IF "$(DEBUG)"=="yes"
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP_DEBUG)
|
|
|
|
!ELSE
|
|
|
|
CURL_LIBCURL_LIBNAME=$(LIB_NAME_IMP)
|
|
|
|
!ENDIF
|
|
|
|
!ENDIF
|
|
|
|
|
2012-12-27 06:30:54 +08:00
|
|
|
CURL_FROM_LIBCURL=$(CURL_DIROBJ)\tool_hugehelp.obj \
|
2013-01-04 09:50:28 +08:00
|
|
|
$(CURL_DIROBJ)\nonblock.obj \
|
2014-03-28 22:12:12 +08:00
|
|
|
$(CURL_DIROBJ)\strtoofft.obj \
|
2018-01-31 08:12:25 +08:00
|
|
|
$(CURL_DIROBJ)\warnless.obj \
|
2020-08-01 03:36:56 +08:00
|
|
|
$(CURL_DIROBJ)\curl_multibyte.obj \
|
2020-09-09 21:41:25 +08:00
|
|
|
$(CURL_DIROBJ)\version_win32.obj \
|
|
|
|
$(CURL_DIROBJ)\dynbuf.obj
|
2020-11-20 06:20:18 +08:00
|
|
|
|
2012-06-15 01:19:18 +08:00
|
|
|
$(PROGRAM_NAME): $(CURL_DIROBJ) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
|
|
|
|
$(CURL_LINK) $(CURL_LFLAGS) $(CURL_LIBCURL_LIBNAME) $(WIN_LIBS) $(CURL_FROM_LIBCURL) $(EXE_OBJS)
|
|
|
|
$(MANIFESTTOOL)
|
|
|
|
|
2022-09-16 00:41:17 +08:00
|
|
|
{$(CURL_SRC_DIR)\}.c{$(CURL_DIROBJ)\}.obj::
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$(CURL_DIROBJ)\\" $<
|
2012-06-15 01:19:18 +08:00
|
|
|
|
2012-12-27 06:30:54 +08:00
|
|
|
$(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Zm200 /Fo"$@" $(CURL_SRC_DIR)\tool_hugehelp.c
|
2013-01-04 09:50:28 +08:00
|
|
|
$(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c
|
|
|
|
$(CURL_DIROBJ)\strtoofft.obj: ../lib/strtoofft.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strtoofft.c
|
2014-03-28 22:12:12 +08:00
|
|
|
$(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c
|
2019-04-14 04:55:51 +08:00
|
|
|
$(CURL_DIROBJ)\curl_multibyte.obj: ../lib/curl_multibyte.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_multibyte.c
|
2020-08-01 03:36:56 +08:00
|
|
|
$(CURL_DIROBJ)\version_win32.obj: ../lib/version_win32.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/version_win32.c
|
2020-09-09 21:41:25 +08:00
|
|
|
$(CURL_DIROBJ)\dynbuf.obj: ../lib/dynbuf.c
|
|
|
|
$(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/dynbuf.c
|
2012-06-15 01:19:18 +08:00
|
|
|
$(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc
|
|
|
|
rc $(CURL_RC_FLAGS)
|
|
|
|
|
|
|
|
!ENDIF # End of case where a config was provided.
|
2018-04-04 17:32:19 +08:00
|
|
|
|
2023-02-21 16:38:37 +08:00
|
|
|
# Makefile.vc's clean removes (LIB)CURL_DIROBJ and DIRDIST dirs then calls
|
|
|
|
# this clean. Note those are the original directories we control and not the
|
|
|
|
# directories possibly modified by this makefile to point to user-specified
|
|
|
|
# directories.
|
|
|
|
# For example, don't remove DIRDIST here since it may contain user files if it
|
|
|
|
# has been changed by WITH_PREFIX to a different output dir (eg C:\usr\local).
|
2018-04-04 17:32:19 +08:00
|
|
|
clean:
|
|
|
|
@-erase /s *.dll 2> NUL
|
|
|
|
@-erase /s *.exp 2> NUL
|
|
|
|
@-erase /s *.idb 2> NUL
|
|
|
|
@-erase /s *.lib 2> NUL
|
|
|
|
@-erase /s *.obj 2> NUL
|
|
|
|
@-erase /s *.pch 2> NUL
|
|
|
|
@-erase /s *.pdb 2> NUL
|
|
|
|
@-erase /s *.res 2> NUL
|