quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

Makefile.vc (8026B)


      1 #***************************************************************************
      2 #                                  _   _ ____  _
      3 #  Project                     ___| | | |  _ \| |
      4 #                             / __| | | | |_) | |
      5 #                            | (__| |_| |  _ <| |___
      6 #                             \___|\___/|_| \_\_____|
      7 #
      8 # Copyright (C) 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.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 # SPDX-License-Identifier: curl
     22 #
     23 #***************************************************************************
     24 
     25 !MESSAGE
     26 !MESSAGE WARNING:
     27 !MESSAGE
     28 !MESSAGE The winbuild build system is deprecated and will be removed in
     29 !MESSAGE September 2025 in favor of the CMake build system.
     30 !MESSAGE
     31 !MESSAGE Please see docs/INSTALL-CMAKE.md : "Migrating from winbuild builds"
     32 !MESSAGE
     33 !MESSAGE To use the winbuild build system you must acknowledge this warning by
     34 !MESSAGE setting command line option WINBUILD_ACKNOWLEDGE_DEPRECATED=yes
     35 !MESSAGE
     36 !IF "$(WINBUILD_ACKNOWLEDGE_DEPRECATED)"!="yes"
     37 !ERROR The user must acknowledge the deprecation warning to continue.
     38 !ENDIF
     39 
     40 !IF "$(MODE)"=="static"
     41 TARGET = $(LIB_NAME_STATIC)
     42 AS_DLL = false
     43 CFGSET=true
     44 !ELSEIF "$(MODE)"=="dll"
     45 TARGET = $(LIB_NAME_DLL)
     46 AS_DLL = true
     47 CFGSET=true
     48 !ELSE
     49 !MESSAGE Invalid mode: $(MODE)
     50 
     51 #######################
     52 # Usage
     53 #
     54 
     55 !MESSAGE See winbuild/README.md for usage
     56 !ERROR please choose a valid mode
     57 
     58 !ENDIF
     59 
     60 !INCLUDE "../lib/Makefile.inc"
     61 CSOURCES=$(CSOURCES:  = )
     62 LIBCURL_OBJS=$(CSOURCES:.c=.obj)
     63 
     64 !INCLUDE "../src/Makefile.inc"
     65 CURL_CFILES=$(CURL_CFILES:  = )
     66 CURL_OBJS=$(CURL_CFILES:.c=.obj)
     67 
     68 
     69 # backwards compatible check for USE_SSPI
     70 !IFDEF USE_SSPI
     71 ENABLE_SSPI = $(USE_SSPI)
     72 !ENDIF
     73 
     74 # default options
     75 
     76 !IFNDEF MACHINE
     77 # Note: nmake magically changes the value of PROCESSOR_ARCHITECTURE from "AMD64"
     78 # to "x86" when building in a 32 bit build environment on a 64 bit machine.
     79 !IF "$(PROCESSOR_ARCHITECTURE)"=="AMD64"
     80 MACHINE = x64
     81 !ELSE
     82 MACHINE = x86
     83 !ENDIF
     84 !ENDIF
     85 
     86 !IFNDEF ENABLE_IDN
     87 USE_IDN = true
     88 !ELSEIF "$(ENABLE_IDN)"=="yes"
     89 USE_IDN = true
     90 !ELSEIF "$(ENABLE_IDN)"=="no"
     91 USE_IDN = false
     92 !ENDIF
     93 
     94 !IFNDEF ENABLE_IPV6
     95 USE_IPV6 = true
     96 !ELSEIF "$(ENABLE_IPV6)"=="yes"
     97 USE_IPV6 = true
     98 !ELSEIF "$(ENABLE_IPV6)"=="no"
     99 USE_IPV6 = false
    100 !ENDIF
    101 
    102 !IFNDEF ENABLE_SSPI
    103 USE_SSPI = true
    104 !ELSEIF "$(ENABLE_SSPI)"=="yes"
    105 USE_SSPI = true
    106 !ELSEIF "$(ENABLE_SSPI)"=="no"
    107 USE_SSPI = false
    108 !ENDIF
    109 
    110 !IFNDEF ENABLE_SCHANNEL
    111 !IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS) || DEFINED(WITH_WOLFSSL)
    112 USE_SCHANNEL = false
    113 !ELSE
    114 USE_SCHANNEL = $(USE_SSPI)
    115 !ENDIF
    116 !ELSEIF "$(ENABLE_SCHANNEL)"=="yes"
    117 USE_SCHANNEL = true
    118 !ELSEIF "$(ENABLE_SCHANNEL)"=="no"
    119 USE_SCHANNEL = false
    120 !ENDIF
    121 
    122 !IFNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
    123 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
    124 !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="yes"
    125 !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
    126 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
    127 !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="no"
    128 !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
    129 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = false
    130 !ENDIF
    131 
    132 !IFNDEF ENABLE_UNICODE
    133 USE_UNICODE = false
    134 !ELSEIF "$(ENABLE_UNICODE)"=="yes"
    135 USE_UNICODE = true
    136 !ELSEIF "$(ENABLE_UNICODE)"=="no"
    137 USE_UNICODE = false
    138 !ENDIF
    139 
    140 CONFIG_NAME_LIB = libcurl
    141 
    142 !IF "$(WITH_SSL)"=="dll"
    143 USE_SSL = true
    144 SSL     = dll
    145 !ELSEIF "$(WITH_SSL)"=="static"
    146 USE_SSL = true
    147 SSL     = static
    148 !ENDIF
    149 
    150 !IF "$(ENABLE_NGHTTP2)"=="yes"
    151 # compatibility bit, WITH_NGHTTP2 is the correct flag
    152 WITH_NGHTTP2 = dll
    153 USE_NGHTTP2  = true
    154 NGHTTP2      = dll
    155 !ELSEIF "$(WITH_NGHTTP2)"=="dll"
    156 USE_NGHTTP2 = true
    157 NGHTTP2     = dll
    158 !ELSEIF "$(WITH_NGHTTP2)"=="static"
    159 USE_NGHTTP2 = true
    160 NGHTTP2     = static
    161 !ENDIF
    162 
    163 !IFNDEF USE_NGHTTP2
    164 USE_NGHTTP2 = false
    165 !ENDIF
    166 
    167 !IF "$(ENABLE_MSH3)"=="yes"
    168 # compatibility bit, WITH_MSH3 is the correct flag
    169 WITH_MSH3    = dll
    170 USE_MSH3     = true
    171 MSH3         = dll
    172 !ELSEIF "$(WITH_MSH3)"=="dll"
    173 USE_MSH3     = true
    174 MSH3         = dll
    175 !ELSEIF "$(WITH_MSH3)"=="static"
    176 USE_MSH3     = true
    177 MSH3         = static
    178 !ENDIF
    179 
    180 !IFNDEF USE_MSH3
    181 USE_MSH3 = false
    182 !ENDIF
    183 
    184 !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
    185 USE_MBEDTLS = true
    186 MBEDTLS     = $(WITH_MBEDTLS)
    187 !ENDIF
    188 
    189 !IF "$(WITH_WOLFSSL)"=="dll" || "$(WITH_WOLFSSL)"=="static"
    190 USE_WOLFSSL = true
    191 WOLFSSL     = $(WITH_WOLFSSL)
    192 !ENDIF
    193 
    194 !IF "$(WITH_CARES)"=="dll"
    195 USE_CARES = true
    196 CARES     = dll
    197 !ELSEIF "$(WITH_CARES)"=="static"
    198 USE_CARES = true
    199 CARES     = static
    200 !ENDIF
    201 
    202 !IF "$(WITH_ZLIB)"=="dll"
    203 USE_ZLIB = true
    204 ZLIB     = dll
    205 !ELSEIF "$(WITH_ZLIB)"=="static"
    206 USE_ZLIB = true
    207 ZLIB     = static
    208 !ENDIF
    209 
    210 !IF "$(WITH_SSH2)"=="dll"
    211 USE_SSH2 = true
    212 SSH2     = dll
    213 !ELSEIF "$(WITH_SSH2)"=="static"
    214 USE_SSH2 = true
    215 SSH2     = static
    216 !ENDIF
    217 
    218 !IF "$(WITH_SSH)"=="dll"
    219 USE_SSH = true
    220 SSH     = dll
    221 !ELSEIF "$(WITH_SSH)"=="static"
    222 USE_SSH = true
    223 SSH     = static
    224 !ENDIF
    225 
    226 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE)
    227 
    228 !IF "$(DEBUG)"=="yes"
    229 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
    230 !ELSE
    231 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
    232 !ENDIF
    233 
    234 !IF "$(AS_DLL)"=="true"
    235 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
    236 !ELSE
    237 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
    238 !ENDIF
    239 
    240 !IF "$(USE_SSL)"=="true"
    241 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
    242 !ENDIF
    243 
    244 !IF "$(USE_MBEDTLS)"=="true"
    245 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS)
    246 !ENDIF
    247 
    248 !IF "$(USE_WOLFSSL)"=="true"
    249 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-wolfssl-$(WOLFSSL)
    250 !ENDIF
    251 
    252 !IF "$(USE_CARES)"=="true"
    253 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
    254 !ENDIF
    255 
    256 !IF "$(USE_ZLIB)"=="true"
    257 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
    258 !ENDIF
    259 
    260 !IF "$(USE_SSH2)"=="true"
    261 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
    262 !ENDIF
    263 
    264 !IF "$(USE_SSH)"=="true"
    265 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh-$(SSH)
    266 !ENDIF
    267 
    268 !IF "$(USE_IPV6)"=="true"
    269 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
    270 !ENDIF
    271 
    272 !IF "$(USE_SSPI)"=="true"
    273 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
    274 !ENDIF
    275 
    276 !IF "$(USE_SCHANNEL)"=="true"
    277 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-schannel
    278 !ENDIF
    279 
    280 !IF "$(USE_NGHTTP2)"=="true"
    281 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2)
    282 !ENDIF
    283 
    284 !IF "$(USE_MSH3)"=="true"
    285 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-msh3
    286 !ENDIF
    287 
    288 !MESSAGE configuration name: $(CONFIG_NAME_LIB)
    289 
    290 # Note these directories are removed by this makefile's 'clean' so they should
    291 # not be changed to point to user-specified directories that may contain other
    292 # data. MakefileBuild.vc uses the same variable names but allows some user
    293 # changes and therefore does not remove the directories.
    294 BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
    295 LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
    296 CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
    297 DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
    298 
    299 $(MODE):
    300 	@echo LIBCURL_OBJS = \> LIBCURL_OBJS.inc
    301 	@for %%i in ($(LIBCURL_OBJS)) do @echo $(LIBCURL_DIROBJ)/%%i \>> LIBCURL_OBJS.inc
    302 	@echo. >> LIBCURL_OBJS.inc
    303 
    304 	@echo CURL_OBJS = \> CURL_OBJS.inc
    305 	@for %%i in ($(CURL_OBJS)) do @echo $(CURL_DIROBJ)/%%i \>> CURL_OBJS.inc
    306 	@echo. >> CURL_OBJS.inc
    307 
    308 	@SET CONFIG_NAME_LIB=$(CONFIG_NAME_LIB)
    309 	@SET MACHINE=$(MACHINE)
    310 	@SET USE_NGHTTP2=$(USE_NGHTTP2)
    311 	@SET USE_MSH3=$(USE_MSH3)
    312 	@SET USE_IDN=$(USE_IDN)
    313 	@SET USE_IPV6=$(USE_IPV6)
    314 	@SET USE_SSPI=$(USE_SSPI)
    315 	@SET USE_SCHANNEL=$(USE_SCHANNEL)
    316 	@SET USE_UNICODE=$(USE_UNICODE)
    317 # compatibility bit
    318 	@SET WITH_NGHTTP2=$(WITH_NGHTTP2)
    319 
    320 	@$(MAKE) /NOLOGO /F MakefileBuild.vc
    321 
    322 copy_from_lib:
    323 	echo copying .c...
    324 	FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\
    325 
    326 clean:
    327 	@if exist $(LIBCURL_DIROBJ) rd /s /q $(LIBCURL_DIROBJ)
    328 	@if exist $(CURL_DIROBJ) rd /s /q $(CURL_DIROBJ)
    329 	@if exist $(DIRDIST) rd /s /q $(DIRDIST)
    330 	$(MAKE) /NOLOGO /F MakefileBuild.vc $@