Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 189 lines (157 sloc) 5.124 kb
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
1 !IF "$(MODE)"=="static"
2 TARGET = $(LIB_NAME_STATIC)
3 AS_DLL = false
4 CFGSET=true
5 !ELSEIF "$(MODE)"=="dll"
6 TARGET = $(LIB_NAME_DLL)
7 AS_DLL = true
8 CFGSET=true
9 !ELSE
10 !MESSAGE Invalid mode: $(MODE)
11
12 #######################
13 # Usage
14 #
15
d7c9f2f @mback2k winbuild: Aligned BUILD.WINDOWS.txt and Makefile.vc usage help
mback2k authored
16 !MESSAGE Usage: nmake /f Makefile.vc mode=<static or dll> <options>
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
17 !MESSAGE where <options> is one or many of:
18 !MESSAGE VC=<6,7,8,9,10> - VC versions
19 !MESSAGE WITH_DEVEL=<path> - Paths for the development files (SSL, zlib, etc.)
d7c9f2f @mback2k winbuild: Aligned BUILD.WINDOWS.txt and Makefile.vc usage help
mback2k authored
20 !MESSAGE Defaults to sibbling directory deps: ../deps
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
21 !MESSAGE Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/
22 !MESSAGE Uncompress them into the deps folder.
23 !MESSAGE WITH_SSL=<dll or static> - Enable OpenSSL support, DLL or static
d7c9f2f @mback2k winbuild: Aligned BUILD.WINDOWS.txt and Makefile.vc usage help
mback2k authored
24 !MESSAGE WITH_ZLIB=<dll or static> - Enable zlib support, DLL or static
25 !MESSAGE WITH_SSH2=<dll or static> - Enable libSSH2 support, DLL or static
26 !MESSAGE ENABLE_IDN=<yes or no> - Enable use of Windows IDN APIs, defaults to yes
27 !MESSAGE Requires Windows Vista or later, or installation from:
28 !MESSAGE http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109-07607425A815
f665e5d @mback2k winbuild: Adjusted order of options to generated config name
mback2k authored
29 !MESSAGE ENABLE_IPV6=<yes or no> - Enable IPv6, defaults to yes
30 !MESSAGE ENABLE_SSPI=<yes or no> - Enable SSPI support, defaults to yes
8a57b3c @mback2k winbuild: Added support for building with SPNEGO enabled
mback2k authored
31 !MESSAGE ENABLE_SPNEGO=<yes or no> - Enable Simple and Protected GSSAPI Negotiation Mechanism, defaults to yes
d7c9f2f @mback2k winbuild: Aligned BUILD.WINDOWS.txt and Makefile.vc usage help
mback2k authored
32 !MESSAGE ENABLE_WINSSL=<yes or no> - Enable native Windows SSL support, defaults to yes
33 !MESSAGE GEN_PDB=<yes or no> - Generate Program Database (debug symbols for release build)
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
34 !MESSAGE DEBUG=<yes or no> - Debug builds
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
35 !ERROR please choose a valid mode
36
37 !ENDIF
38
39 !INCLUDE "../lib/Makefile.inc"
40 LIBCURL_OBJS=$(CSOURCES:.c=.obj)
41
42 top_srcdir=..
43 !INCLUDE "../src/Makefile.inc"
44
45 # hugehelp has a special rule
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
46 CURL_OBJS=$(CURL_CFILES:hugehelp.c=)
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
47
48 CURL_OBJS=$(CURL_OBJS:.c=.obj)
49
8687157 @mback2k winbuild: Aligned USE_SSPI with other USE_x defines
mback2k authored
50
51 # backwards compatible check for USE_SSPI
52 !IFDEF USE_SSPI
53 ENABLE_SSPI = $(USE_SSPI)
54 !ENDIF
55
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
56 # default options
f665e5d @mback2k winbuild: Adjusted order of options to generated config name
mback2k authored
57 !IFNDEF ENABLE_IDN
58 USE_IDN = true
59 !ELSEIF "$(ENABLE_IDN)"=="yes"
60 USE_IDN = true
61 !ELSEIF "$(ENABLE_IDN)"=="no"
62 USE_IDN = false
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
63 !ENDIF
64
00e615d @pierrejoye - s, use, enable, for options name, avoiding conflicts with the names us...
pierrejoye authored
65 !IFNDEF ENABLE_IPV6
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
66 USE_IPV6 = true
00e615d @pierrejoye - s, use, enable, for options name, avoiding conflicts with the names us...
pierrejoye authored
67 !ELSEIF "$(ENABLE_IPV6)"=="yes"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
68 USE_IPV6 = true
69 !ELSEIF "$(ENABLE_IPV6)"=="no"
70 USE_IPV6 = false
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
71 !ENDIF
72
f665e5d @mback2k winbuild: Adjusted order of options to generated config name
mback2k authored
73 !IFNDEF ENABLE_SSPI
74 USE_SSPI = true
75 !ELSEIF "$(ENABLE_SSPI)"=="yes"
76 USE_SSPI = true
77 !ELSEIF "$(ENABLE_SSPI)"=="no"
78 USE_SSPI = false
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
79 !ENDIF
80
8a57b3c @mback2k winbuild: Added support for building with SPNEGO enabled
mback2k authored
81 !IFNDEF ENABLE_SPNEGO
82 USE_SPNEGO = true
83 !ELSEIF "$(ENABLE_SPNEGO)"=="yes"
84 USE_SPNEGO = true
85 !ELSEIF "$(ENABLE_SPNEGO)"=="no"
86 USE_SPNEGO = false
87 !ENDIF
88
9d8375c @mback2k winbuild: Allow SSPI build with or without Schannel
mback2k authored
89 !IFNDEF ENABLE_WINSSL
d39bbcf @mback2k winbuild: Make USE_WINSSL depend on USE_SSPI
mback2k authored
90 USE_WINSSL = $(USE_SSPI)
9d8375c @mback2k winbuild: Allow SSPI build with or without Schannel
mback2k authored
91 !ELSEIF "$(ENABLE_WINSSL)"=="yes"
92 USE_WINSSL = true
93 !ELSEIF "$(ENABLE_WINSSL)"=="no"
94 USE_WINSSL = false
95 !ENDIF
96
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
97 CONFIG_NAME_LIB = libcurl
98
99 !IF "$(WITH_SSL)"=="dll"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
100 USE_SSL = true
101 SSL = dll
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
102 !ELSEIF "$(WITH_SSL)"=="static"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
103 USE_SSL = true
104 SSL = static
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
105 !ENDIF
106
107 !IF "$(WITH_ZLIB)"=="dll"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
108 USE_ZLIB = true
109 ZLIB = dll
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
110 !ELSEIF "$(WITH_ZLIB)"=="static"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
111 USE_ZLIB = true
112 ZLIB = static
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
113 !ENDIF
114
115 !IF "$(WITH_SSH2)"=="dll"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
116 USE_SSH2 = true
117 SSH2 = dll
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
118 !ELSEIF "$(WITH_SSH2)"=="static"
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
119 USE_SSH2 = true
120 SSH2 = static
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
121 !ENDIF
122
123 !IF "$(DEBUG)"=="yes"
124 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-debug
125 !ELSE
126 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-release
127 !ENDIF
128
aeca33f @mback2k winbuild: Clean up formatting and variable naming
mback2k authored
129 !IF "$(AS_DLL)"=="true"
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
130 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-dll
131 !ELSE
132 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-static
133 !ENDIF
134
135 !IF "$(USE_SSL)"=="true"
136 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssl-$(SSL)
137 !ENDIF
138
139 !IF "$(USE_ZLIB)"=="true"
140 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-zlib-$(ZLIB)
141 !ENDIF
142
143 !IF "$(USE_SSH2)"=="true"
144 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ssh2-$(SSH2)
145 !ENDIF
146
147 !IF "$(USE_IPV6)"=="true"
148 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-ipv6
149 !ENDIF
150
151 !IF "$(USE_SSPI)"=="true"
152 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-sspi
153 !ENDIF
154
8a57b3c @mback2k winbuild: Added support for building with SPNEGO enabled
mback2k authored
155 !IF "$(USE_SPNEGO)"=="true"
156 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-spnego
157 !ENDIF
158
9d8375c @mback2k winbuild: Allow SSPI build with or without Schannel
mback2k authored
159 !IF "$(USE_WINSSL)"=="true"
160 CONFIG_NAME_LIB = $(CONFIG_NAME_LIB)-winssl
161 !ENDIF
162
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
163 !MESSAGE configuration name: $(CONFIG_NAME_LIB)
164
165 BUILD_DIR=../builds/$(CONFIG_NAME_LIB)
166 LIBCURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-lib
167 CURL_DIROBJ = ..\builds\$(CONFIG_NAME_LIB)-obj-curl
168 DIRDIST = ..\builds\$(CONFIG_NAME_LIB)\
169
170 $(MODE):
171 @SET LIBCURL_DIROBJ=$(LIBCURL_DIROBJ)
172 @SET MACRO_NAME=LIBCURL_OBJS
173 @SET OUTFILE=LIBCURL_OBJS.inc
174 @gen_resp_file.bat $(LIBCURL_OBJS)
175 @SET LIBCURL_DIROBJ=$(CURL_DIROBJ)
176 @SET MACRO_NAME=CURL_OBJS
177 @SET OUTFILE=CURL_OBJS.inc
178 @gen_resp_file.bat $(CURL_OBJS)
72c7c1d @mback2k winbuild: Fixed environment variables being lost
mback2k authored
179 @SET USE_IDN=$(USE_IDN)
f665e5d @mback2k winbuild: Adjusted order of options to generated config name
mback2k authored
180 @SET USE_IPV6=$(USE_IPV6)
181 @SET USE_SSPI=$(USE_SSPI)
8a57b3c @mback2k winbuild: Added support for building with SPNEGO enabled
mback2k authored
182 @SET USE_SPNEGO=$(USE_SPNEGO)
9d8375c @mback2k winbuild: Allow SSPI build with or without Schannel
mback2k authored
183 @SET USE_WINSSL=$(USE_WINSSL)
76ac6b9 @pierrejoye Windows build: alternative makefile
pierrejoye authored
184 @$(MAKE) /NOLOGO /F MakefileBuild.vc
185
186 copy_from_lib:
187 echo copying .c...
188 FOR %%i IN ($(CURLX_ONES:/=\)) DO copy %%i ..\src\
Something went wrong with that request. Please try again.