Debian Codegraph @

deps/curl/winbuild/Makefile.vc

raw
1 #***************************************************************************
2 # _ _ ____ _
3 # Project ___| | | | _ \| |
4 # / __| | | | |_) | |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1999 - 2019, Daniel Stenberg, <[email protected]>, 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"
24 TARGET = $(LIB_NAME_STATIC)
25 AS_DLL = false
26 CFGSET=true
27 !ELSEIF "$(MODE)"=="dll"
28 TARGET = $(LIB_NAME_DLL)
29 AS_DLL = true
30 CFGSET=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_WINSSL=<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"
77 LIBCURL_OBJS=$(CSOURCES:.c=.obj)
78
79 !INCLUDE "../src/Makefile.inc"
80
81 # tool_hugehelp has a special rule
82 CURL_OBJS=$(CURL_CFILES:tool_hugehelp.c=)
83
84 CURL_OBJS=$(CURL_OBJS:.c=.obj)
85
86
87 # backwards compatible check for USE_SSPI
88 !IFDEF USE_SSPI
89 ENABLE_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"
98 MACHINE = x64
99 !ELSE
100 MACHINE = x86
101 !ENDIF
102 !ENDIF
103
104 !IFNDEF ENABLE_IDN
105 USE_IDN = true
106 !ELSEIF "$(ENABLE_IDN)"=="yes"
107 USE_IDN = true
108 !ELSEIF "$(ENABLE_IDN)"=="no"
109 USE_IDN = false
110 !ENDIF
111
112 !IFNDEF ENABLE_IPV6
113 USE_IPV6 = true
114 !ELSEIF "$(ENABLE_IPV6)"=="yes"
115 USE_IPV6 = true
116 !ELSEIF "$(ENABLE_IPV6)"=="no"
117 USE_IPV6 = false
118 !ENDIF
119
120 !IFNDEF ENABLE_SSPI
121 USE_SSPI = true
122 !ELSEIF "$(ENABLE_SSPI)"=="yes"
123 USE_SSPI = true
124 !ELSEIF "$(ENABLE_SSPI)"=="no"
125 USE_SSPI = false
126 !ENDIF
127
128 !IFNDEF ENABLE_WINSSL
129 !IF DEFINED(WITH_SSL) || DEFINED(WITH_MBEDTLS)
130 USE_WINSSL = false
131 !ELSE
132 USE_WINSSL = $(USE_SSPI)
133 !ENDIF
134 !ELSEIF "$(ENABLE_WINSSL)"=="yes"
135 USE_WINSSL = true
136 !ELSEIF "$(ENABLE_WINSSL)"=="no"
137 USE_WINSSL = false
138 !ENDIF
139
140 !IFNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
141 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
142 !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="yes"
143 !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
144 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = true
145 !ELSEIF "$(ENABLE_OPENSSL_AUTO_LOAD_CONFIG)"=="no"
146 !UNDEF ENABLE_OPENSSL_AUTO_LOAD_CONFIG
147 ENABLE_OPENSSL_AUTO_LOAD_CONFIG = false
148 !ENDIF
149
150 !IFNDEF ENABLE_UNICODE
151 USE_UNICODE = false
152 !ELSEIF "$(ENABLE_UNICODE)"=="yes"
153 USE_UNICODE = true
154 !ELSEIF "$(ENABLE_UNICODE)"=="no"
155 USE_UNICODE = false
156 !ENDIF
157
158 CONFIG_NAME_LIB = libcurl
159
160 !IF "$(WITH_SSL)"=="dll"
161 USE_SSL = true
162 SSL = dll
163 !ELSEIF "$(WITH_SSL)"=="static"
164 USE_SSL = true
165 SSL = static
166 !ENDIF
167
168 !IF "$(ENABLE_NGHTTP2)"=="yes"
169 # compatibility bit, WITH_NGHTTP2 is the correct flag
170 WITH_NGHTTP2 = dll
171 USE_NGHTTP2 = true
172 NGHTTP2 = dll
173 !ELSEIF "$(WITH_NGHTTP2)"=="dll"
174 USE_NGHTTP2 = true
175 NGHTTP2 = dll
176 !ELSEIF "$(WITH_NGHTTP2)"=="static"
177 USE_NGHTTP2 = true
178 NGHTTP2 = static
179 !ENDIF
180
181 !IFNDEF USE_NGHTTP2
182 USE_NGHTTP2 = false
183 !ENDIF
184
185 !IF "$(WITH_MBEDTLS)"=="dll" || "$(WITH_MBEDTLS)"=="static"
186 USE_MBEDTLS = true
187 MBEDTLS = $(WITH_MBEDTLS)
188 !ENDIF
189
190 !IF "$(WITH_CARES)"=="dll"
191 USE_CARES = true
192 CARES = dll
193 !ELSEIF "$(WITH_CARES)"=="static"
194 USE_CARES = true
195 CARES = static
196 !ENDIF
197
198 !IF "$(WITH_ZLIB)"=="dll"
199 USE_ZLIB = true
200 ZLIB = dll
201 !ELSEIF "$(WITH_ZLIB)"=="static"
202 USE_ZLIB = true
203 ZLIB = static
204 !ENDIF
205
206 !IF "$(WITH_SSH2)"=="dll"
207 USE_SSH2 = true
208 SSH2 = dll
209 !ELSEIF "$(WITH_SSH2)"=="static"
210 USE_SSH2 = true
211 SSH2 = static
212 !ENDIF
213
214 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-vc$(VC)-$(MACHINE)
215
216 !IF "$(DEBUG)"=="yes"
217 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
218 !ELSE
219 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
220 !ENDIF
221
222 !IF "$(AS_DLL)"=="true"
223 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
224 !ELSE
225 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
226 !ENDIF
227
228 !IF "$(USE_SSL)"=="true"
229 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
230 !ENDIF
231
232 !IF "$(USE_MBEDTLS)"=="true"
233 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-mbedtls-$(MBEDTLS)
234 !ENDIF
235
236 !IF "$(USE_CARES)"=="true"
237 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-cares-$(CARES)
238 !ENDIF
239
240 !IF "$(USE_ZLIB)"=="true"
241 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
242 !ENDIF
243
244 !IF "$(USE_SSH2)"=="true"
245 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
246 !ENDIF
247
248 !IF "$(USE_IPV6)"=="true"
249 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
250 !ENDIF
251
252 !IF "$(USE_SSPI)"=="true"
253 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
254 !ENDIF
255
256 !IF "$(USE_WINSSL)"=="true"
257 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl
258 !ENDIF
259
260 !IF "$(USE_NGHTTP2)"=="true"
261 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-nghttp2-$(NGHTTP2)
262 !ENDIF
263
264 !MESSAGE configuration name: $(CONFIG_NAME_LIB)
265
266 BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
267 LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
268 CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
269 DIRDIST = ..\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_WINSSL=$(USE_WINSSL)
289 @SET USE_UNICODE=$(USE_UNICODE)
290 # compatibility bit
291 @SET WITH_NGHTTP2=$(WITH_NGHTTP2)
292
293 @$(MAKE) /NOLOGO /F MakefileBuild.vc
294
295 copy_from_lib:
296 echo copying .c...
297 FOR %%i IN ($(CURLX_CFILES:/=\)) DO copy %%i ..\src\
298
299 clean:
300 $(MAKE) /NOLOGO /F MakefileBuild.vc $@