Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / src / Makefile.vc8
blob9ad02b6781c6680787eaa4dd921b1ad334708a0b
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.
9 ##
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
18 !IFNDEF ZLIB_PATH
19 ZLIB_PATH = ../../zlib-1.2.3
20 !ENDIF
22 !IFNDEF OPENSSL_PATH
23 OPENSSL_PATH = ../../openssl-0.9.8g
24 !ENDIF
26 !IFNDEF MACHINE
27 MACHINE  = X86
28 !ENDIF
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/
42 # WINDOWS_SSPI = 1
44 !IFDEF WINDOWS_SSPI
45 !IFNDEF WINDOWS_SDK_PATH
46 WINDOWS_SDK_PATH = "C:\Program Files\Microsoft SDK"
47 !ENDIF
48 !ENDIF
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)"
54 ZLIB_LIBS     = zlib.lib
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
63 RTLIB   = /MD
64 RTLIBD  = /MDd
66 !IF "$(RTLIBCFG)" == "static"
67 RTLIB  = /MT
68 RTLIBD = /MTd
69 !ENDIF
71 ## Release
72 CCR   = cl.exe $(RTLIB) /O2 /DNDEBUG
73 LINKR = link.exe /incremental:no /libpath:"../lib"
74 RCR   = rc.exe /dCURLDEBUG=0
76 ## Debug
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
87 # version!
88 MANIFESTTOOL = mt -manifest $(PROGRAM_NAME).manifest -outputresource:$(PROGRAM_NAME);1
90 !IFDEF WINDOWS_SSPI
91 CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
92 !ENDIF
94 RELEASE_OBJS= \
95         hugehelpr.obj \
96         writeoutr.obj \
97         urlglobr.obj \
98         getpassr.obj \
99         homedirr.obj \
100         curlutilr.obj \
101         strtoofftr.obj \
102         mainr.obj \
103         curlr.res
105 DEBUG_OBJS= \
106         hugehelpd.obj \
107         writeoutd.obj \
108         urlglobd.obj \
109         getpassd.obj \
110         homedird.obj \
111         curlutild.obj \
112         strtoofftd.obj \
113         maind.obj \
114         curld.res
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
129 !ENDIF
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)
139 !ENDIF
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)
149 !ENDIF
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)
159 !ENDIF
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)
169 !ENDIF
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)
179 !ENDIF
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)
189 !ENDIF
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)
199 !ENDIF
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)
209 !ENDIF
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)
219 !ENDIF
222 LINKLIBS       = $(LINKLIBS) wsock32.lib bufferoverflowu.lib wldap32.lib
223 LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) wsock32.lib bufferoverflowu.lib wldap32.lib
225 all : release
227 release: $(RELEASE_OBJS)
228         $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS)
229         $(MANIFESTTOOL)
231 debug: $(DEBUG_OBJS)
232         $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS)
233         $(MANIFESTTOOL)
235 ## Release
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
250 mainr.obj: main.c
251         $(CCR) $(CFLAGS) /Fo"$@" main.c
252 curlr.res : curl.rc
253         $(RCR) $(RESFLAGS) /Fo"$@" curl.rc
255 ## Debug
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
270 maind.obj: main.c
271         $(CCD) $(CFLAGS) /Fo"$@" main.c
272 curld.res : curl.rc
273         $(RCD) $(RESFLAGS) /Fo"$@" curl.rc
275 clean:
276         @-erase $(PROGRAM_NAME) 2> NUL
277         @-erase $(RELEASE_OBJS) 2> NUL
278         @-erase $(DEBUG_OBJS) 2> NUL
279         @-erase *.idb 2> NUL
280         @-erase *.pdb 2> NUL
281         @-erase *.pch 2> NUL
282         @-erase *.ilk 2> NUL