aboutsummaryrefslogtreecommitdiff
path: root/lib/Makefile.vc6
blob: 767098fa0687a0ee3ecca53795615219d39d77a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#############################################################
#
# Makefile for building libcurl with MSVC6
#
# Usage: see usage message below
#        Should be invoked from \lib directory
#        Edit the paths and desired library name
#        SSL path is only required if you intend compiling
#        with SSL.
#
# This make file leaves the result either a .lib or .dll file
# in the \lib directory. It should be called from the \lib
# directory.
#
# An option would have been to allow the source directory to
# be specified, but I saw no requirement.
#
# Another option would have been to leave the .lib and .dll
# files in the "cfg" directory, but then the make file
# in \src would need to be changed.
#
##############################################################
# CHANGE LOG
# ------------------------------------------------------------
# 05.11.2001   John Lask   Initial Release
# 02.05.2002   Miklos Nemeth OPENSSL_PATH environment; no need
#              for OpenSSL libraries when creating a 
#              static libcurl.lib
# 10.14.2003   Added a target release-libcurl-ssl-dll which
#              is intended to allow static linking of libcurl with dynamic
#              linking of openssl
##############################################################

LIB_NAME       = libcurl
LIB_NAME_DEBUG = libcurld
!IFNDEF OPENSSL_PATH
OPENSSL_PATH   = ../../openssl-0.9.7a
!ENDIF

#############################################################
## Nothing more to do below this line!

CCNODBG   = cl.exe /MD /O2 /D "NDEBUG"
CCDEBUG   = cl.exe /MDd /Od /Gm /Zi  /D "_DEBUG" /GZ
CFLAGSSSL = /D "USE_SSLEAY" /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
CFLAGS = /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB" /YX /FD /c /D "MSDOS"

LNKDLL    = link.exe /DLL  /def:libcurl.def
LNKLIB    = link.exe -lib
LFLAGS    = /nologo
LINKLIBS  = ws2_32.lib winmm.lib
SSLLIBS   = libeay32.lib ssleay32.lib
#  RSAglue.lib was formerly needed in the SSLLIBS
CFGSET    = FALSE

######################
# release

!IF "$(CFG)" == "release"
TARGET =$(LIB_NAME).lib
DIROBJ =.\$(CFG)
LNK    = $(LNKLIB) /out:$(TARGET)
CC     = $(CCNODBG)
CFGSET = TRUE
!ENDIF

######################
# release-dll

!IF "$(CFG)" == "release-dll"
TARGET =$(LIB_NAME).dll
DIROBJ =.\$(CFG)
LNK    = $(LNKDLL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
CC     = $(CCNODBG)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF

######################
# release-ssl

!IF "$(CFG)" == "release-ssl"
TARGET   =$(LIB_NAME).lib
DIROBJ   =.\$(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32"
LNK      = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
LINKLIBS = $(LINKLIBS)
CC       = $(CCNODBG) $(CFLAGSSSL)
CFGSET   = TRUE
!ENDIF

######################
# release-ssl-dll

!IF "$(CFG)" == "release-ssl-dll"
TARGET   =$(LIB_NAME).dll
DIROBJ   =.\$(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
LNK      = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
CC       = $(CCNODBG)  $(CFLAGSSSL)
CFGSET   = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF

######################
# release-libcurl-ssl-dll
!IF "$(CFG)" == "release-libcurl-ssl-dll"
TARGET   =$(LIB_NAME).lib
DIROBJ   =.\$(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
LNK      = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
CC       = $(CCNODBG)  $(CFLAGSSSL)
CFGSET   = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF


######################
# debug

!IF "$(CFG)" == "debug"
TARGET =$(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LNK    = $(LNKLIB) /out:$(TARGET)
CC     = $(CCDEBUG)
CFGSET = TRUE
!ENDIF

######################
# debug-dll

!IF "$(CFG)" == "debug-dll"
TARGET =$(LIB_NAME_DEBUG).dll
DIROBJ =.\$(CFG)
LNK    = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
CC     = $(CCDEBUG)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF

######################
# debug-ssl
#todo
!IF "$(CFG)" == "debug-ssl"
TARGET   = $(LIB_NAME_DEBUG).lib
DIROBJ   =.\$(CFG)
LNK      = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
LINKLIBS = $(LINKLIBS)
CC       = $(CCDEBUG) $(CFLAGSSSL)
CFGSET   = TRUE
!ENDIF

######################
# debug-ssl-dll

!IF "$(CFG)" == "debug-ssl-dll"
TARGET   =$(LIB_NAME_DEBUG).dll
DIROBJ   =.\$(CFG)
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
LNK      = $(LNKDLL) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
CC       = $(CCDEBUG) $(CFLAGSSSL)
CFGSET   = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF

#######################
# Usage
#
!IF "$(CFGSET)" == "FALSE"
!MESSAGE Usage: nmake -f makefile.vc6 CFG=<config> <target>
!MESSAGE where <config> is one of:
!MESSAGE   release          - release static library
!MESSAGE   release-dll      - release dll
!MESSAGE   release-ssl      - release static library with ssl
!MESSAGE   release-ssl-dll  - release dll library with ssl
!MESSAGE   release-libcurl-ssl-dll - static libcurl with shared ssl
!MESSAGE   debug            - debug static library
!MESSAGE   debug-dll        - debug dll
!MESSAGE   debug-ssl        - debug static library with ssl
!MESSAGE   debug-ssl-dll    - debug dll library with ssl
!MESSAGE <target> can be left blank in which case all is assumed
!ERROR please choose a valid configuration "$(CFG)"
!ENDIF

#######################
#
X_OBJS= \
	$(DIROBJ)\base64.obj \
	$(DIROBJ)\cookie.obj \
	$(DIROBJ)\transfer.obj \
	$(DIROBJ)\escape.obj \
	$(DIROBJ)\formdata.obj \
	$(DIROBJ)\ftp.obj \
	$(DIROBJ)\http.obj \
	$(DIROBJ)\http_chunks.obj \
	$(DIROBJ)\ldap.obj \
	$(DIROBJ)\dict.obj \
	$(DIROBJ)\telnet.obj \
	$(DIROBJ)\getdate.obj \
	$(DIROBJ)\getenv.obj \
	$(DIROBJ)\inet_pton.obj \
	$(DIROBJ)\hostip.obj \
	$(DIROBJ)\if2ip.obj \
	$(DIROBJ)\mprintf.obj \
	$(DIROBJ)\netrc.obj \
	$(DIROBJ)\progress.obj \
	$(DIROBJ)\sendf.obj \
	$(DIROBJ)\speedcheck.obj \
	$(DIROBJ)\ssluse.obj \
	$(DIROBJ)\timeval.obj \
	$(DIROBJ)\url.obj \
	$(DIROBJ)\file.obj \
	$(DIROBJ)\getinfo.obj \
	$(DIROBJ)\version.obj \
	$(DIROBJ)\easy.obj \
	$(DIROBJ)\strequal.obj \
	$(DIROBJ)\strtok.obj \
	$(DIROBJ)\connect.obj \
	$(DIROBJ)\hash.obj \
	$(DIROBJ)\llist.obj \
	$(DIROBJ)\share.obj \
	$(DIROBJ)\multi.obj \
	$(DIROBJ)\http_digest.obj \
        $(DIROBJ)\http_negotiate.obj \
        $(DIROBJ)\http_ntlm.obj \
	$(DIROBJ)\md5.obj \
	$(RESOURCE)

all : $(TARGET)


$(TARGET): $(X_OBJS)
	$(LNK) $(LFLAGS) $(LINKLIBS) $(X_OBJS)

$(X_OBJS): $(DIROBJ)

$(DIROBJ):
	@if not exist "$(DIROBJ)" mkdir $(DIROBJ)

.SUFFIXES: .c .obj .res

{.\}.c{$(DIROBJ)\}.obj:
	$(CC) $(CFLAGS) /Fo"$@"  $<

debug-dll\libcurl.res \
debug-ssl-dll\libcurl.res \
release-libcurl-ssl-dll\libcurl.res: libcurl.rc
	rc /dCURLDEBUG=1 /Fo $@ libcurl.rc

release-dll\libcurl.res \
release-ssl-dll\libcurl.res \
release-libcurl-ssl-dll\libcurl.res: libcurl.rc
	rc /dCURLDEBUG=0 /Fo $@ libcurl.rc

clean:
	-@erase $(DIROBJ)\*.obj
	-@erase $(DIROBJ)\*.res
	-@erase vc60.idb
	-@erase vc60.pch