1 #############################################################
2 # $Id: Makefile.vc8,v 1.1.1.1 2008-09-23 16:32:06 hoffman Exp $
4 ## Makefile for building curl.exe with MSVC8
5 ## Use: nmake -f makefile.vc8 [release | debug] [CFG=release-ssl]
6 ## (default is release)
7 ## "nmake -f makefile.vc8 CFG=release-ssl" statically links OpenSSL
8 ## into curl.exe producing a standalone SSL-enabled executable.
10 ## Comments to: Troy Engel <tengel@sonic.net>
11 ## Updated by: Craig Davison <cd@securityfocus.com>
12 ## release-ssl added by Miklos Nemeth <mnemeth@kfkisystems.com>
14 #############################################################
16 PROGRAM_NAME = curl.exe
19 ZLIB_PATH = ../../zlib-1.2.3
23 OPENSSL_PATH = ../../openssl-0.9.8g
30 # USE_WINDOWS_SSPI uses windows libraries to allow NTLM authentication
31 # without an openssl installation and offers the ability to authenticate
32 # using the "current logged in user". Since at least with MSVC8 the sspi.h
33 # header is broken it is either required to install the Windows SDK,
34 # or to fix sspi.h with adding this define at the beginning of sspi.h:
35 # #define FreeCredentialHandle FreeCredentialsHandle
37 # If, for some reason the Windows SDK is installed but not installed
38 # in the default location, you can specify WINDOWS_SDK_PATH.
39 # It can be downloaded from:
40 # http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
45 !IFNDEF WINDOWS_SDK_PATH
46 WINDOWS_SDK_PATH = "C:\Program Files\Microsoft SDK"
50 ########################################################
51 ## Nothing more to do below this line!
52 ZLIB_CFLAGS = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
53 ZLIB_LFLAGS = "/LIBPATH:$(ZLIB_PATH)"
55 ZLIB_IMP_LIBS = zdll.lib
57 SSL_CFLAGS = /DUSE_SSLEAY
58 SSL_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32"
59 SSL_IMP_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32dll"
60 SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib advapi32.lib
62 # Runtime library configuration
66 !IF "$(RTLIBCFG)" == "static"
72 CCR = cl.exe $(RTLIB) /O2 /DNDEBUG
73 LINKR = link.exe /incremental:no /libpath:"../lib"
74 RCR = rc.exe /dCURLDEBUG=0
77 CCD = cl.exe $(RTLIBD) /Gm /ZI /Od /D_DEBUG /RTC1
78 LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
79 RCD = rc.exe /dCURLDEBUG=1
81 CFLAGS = /I../lib /I../include /nologo /W3 /EHsc /DWIN32 /FD /c
82 LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:$(MACHINE)
83 RESFLAGS = /i../include
85 # This manifest thing is for VC8, enabled by the maketgz script that
86 # builds the VC8 version of this makefile. Left commented out in the VC8
88 MANIFESTTOOL = mt -manifest $(PROGRAM_NAME).manifest -outputresource:$(PROGRAM_NAME);1
91 CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
116 #################################################
117 # If CFG not specified, use static libs
119 CFLAGS = $(CFLAGS) /DCURL_STATICLIB
120 LINKLIBS = libcurl.lib
121 LINKLIBS_DEBUG = libcurld.lib
123 #################################################
124 # release dynamic library
126 !IF "$(CFG)" == "release-dll"
127 LINKLIBS = libcurl_imp.lib
128 LINKLIBS_DEBUG = libcurld_imp.lib
131 #################################################
132 # release static library with zlib
134 !IF "$(CFG)" == "release-zlib"
135 CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
136 LINKLIBS = libcurl.lib $(ZLIB_LIBS)
137 LINKLIBS_DEBUG = libcurld.lib $(ZLIB_LIBS)
138 LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS)
141 #################################################
142 # release static library with ssl
144 !IF "$(CFG)" == "release-ssl"
145 CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB
146 LINKLIBS = libcurl.lib $(SSL_LIBS)
147 LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS)
148 LFLAGS = $(LFLAGS) $(SSL_LFLAGS)
151 #################################################
152 # release dynamic library with dynamic ssl
154 !IF "$(CFG)" == "release-dll-ssl-dll"
155 CFLAGS = $(CFLAGS) $(SSL_CFLAGS)
156 LINKLIBS = libcurl_imp.lib $(SSL_LIBS)
157 LINKLIBS_DEBUG = libcurld_imp.lib $(SSL_LIBS)
158 LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS)
161 #################################################
162 # release static library with ssl and zlib
164 !IF "$(CFG)" == "release-ssl-zlib"
165 CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
166 LINKLIBS = libcurl.lib $(SSL_LIBS) $(ZLIB_LIBS)
167 LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) $(ZLIB_LIBS)
168 LFLAGS = $(LFLAGS) $(SSL_LFLAGS) $(ZLIB_LFLAGS)
171 #################################################
172 # release static library with dynamic ssl
174 !IF "$(CFG)" == "release-ssl-dll"
175 CFLAGS = $(CFLAGS) $(SSL_CFLAGS) /DCURL_STATICLIB
176 LINKLIBS = libcurl.lib $(SSL_LIBS)
177 LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS)
178 LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS)
181 #################################################
182 # release static library with dynamic zlib
184 !IF "$(CFG)" == "release-zlib-dll"
185 CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
186 LINKLIBS = libcurl.lib $(ZLIB_IMP_LIBS)
187 LINKLIBS_DEBUG = libcurld.lib $(ZLIB_IMP_LIBS)
188 LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS)
191 #################################################
192 # release dynamic library with dynamic zlib
194 !IF "$(CFG)" == "release-dll-zlib-dll"
195 CFLAGS = $(CFLAGS) $(ZLIB_CFLAGS)
196 LINKLIBS = libcurl_imp.lib $(ZLIB_IMP_LIBS)
197 LINKLIBS_DEBUG = libcurld_imp.lib $(ZLIB_IMP_LIBS)
198 LFLAGS = $(LFLAGS) $(ZLIB_LFLAGS)
201 #################################################
202 # release static library with dynamic ssl and dynamic zlib
204 !IF "$(CFG)" == "release-ssl-dll-zlib-dll"
205 CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS) /DCURL_STATICLIB
206 LINKLIBS = libcurl.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS)
207 LINKLIBS_DEBUG = libcurld.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS)
208 LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS)
211 #################################################
212 # release dynamic library with dynamic ssl and dynamic zlib
214 !IF "$(CFG)" == "release-dll-ssl-dll-zlib-dll"
215 CFLAGS = $(CFLAGS) $(SSL_CFLAGS) $(ZLIB_CFLAGS)
216 LINKLIBS = libcurl_imp.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS)
217 LINKLIBS_DEBUG = libcurld_imp.lib $(SSL_LIBS) $(ZLIB_IMP_LIBS)
218 LFLAGS = $(LFLAGS) $(SSL_IMP_LFLAGS) $(ZLIB_LFLAGS)
222 LINKLIBS = $(LINKLIBS) wsock32.lib bufferoverflowu.lib wldap32.lib
223 LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) wsock32.lib bufferoverflowu.lib wldap32.lib
227 release: $(RELEASE_OBJS)
228 $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS)
232 $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS)
236 hugehelpr.obj: hugehelp.c
237 $(CCR) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c
238 writeoutr.obj: writeout.c
239 $(CCR) $(CFLAGS) /Fo"$@" writeout.c
240 urlglobr.obj: urlglob.c
241 $(CCR) $(CFLAGS) /Fo"$@" urlglob.c
242 getpassr.obj: getpass.c
243 $(CCR) $(CFLAGS) /Fo"$@" getpass.c
244 homedirr.obj: homedir.c
245 $(CCR) $(CFLAGS) /Fo"$@" homedir.c
246 curlutilr.obj: curlutil.c
247 $(CCR) $(CFLAGS) /Fo"$@" curlutil.c
248 strtoofftr.obj: ../lib/strtoofft.c
249 $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c
251 $(CCR) $(CFLAGS) /Fo"$@" main.c
253 $(RCR) $(RESFLAGS) /Fo"$@" curl.rc
256 hugehelpd.obj: hugehelp.c
257 $(CCD) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c
258 writeoutd.obj: writeout.c
259 $(CCD) $(CFLAGS) /Fo"$@" writeout.c
260 urlglobd.obj: urlglob.c
261 $(CCD) $(CFLAGS) /Fo"$@" urlglob.c
262 getpassd.obj: getpass.c
263 $(CCD) $(CFLAGS) /Fo"$@" getpass.c
264 homedird.obj: homedir.c
265 $(CCD) $(CFLAGS) /Fo"$@" homedir.c
266 curlutild.obj: curlutil.c
267 $(CCD) $(CFLAGS) /Fo"$@" curlutil.c
268 strtoofftd.obj: ../lib/strtoofft.c
269 $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c
271 $(CCD) $(CFLAGS) /Fo"$@" main.c
273 $(RCD) $(RESFLAGS) /Fo"$@" curl.rc
276 @-erase $(PROGRAM_NAME) 2> NUL
277 @-erase $(RELEASE_OBJS) 2> NUL
278 @-erase $(DEBUG_OBJS) 2> NUL