cURL / Mailing Lists / curl-library / Single Mail

curl-library

Makefiles for VC6

From: Samuel Díaz García <samueldg_at_arcoscom.com>
Date: Tue, 25 Jan 2005 11:30:47 +0100

Please, this MAKEFILES are for VC6 and use more configs to allow LIBCURL
compile with more options (static/dynamic, release/debug).

This are tested with 7.12.3 and "works for me" after using the LIBCURL.DEF
in 7.12.2 version.

The MAKEFILES are documented as the official ones.

The last person who performed the last modifications to the last oficial VC6
makefiles can modify them to allow "compatibility" with the offical build
options.

Also I attach the libcurl.def file, missing in the 7.12.3 version (or simply
needed for works with these makefiles).

I hope somebody send the correct patches to Daniel to refresh the CVS
version with some of these changes.

Samuel Díaz Garcí­a
Director Gerente
ArcosCom Wireless, S.L.L.

mailto:samueldg_at_arcoscom.com
http://www.arcoscom.com
móvil: 651 93 72 48
tlfn/fax: 956 70 13 15

;
; Definition file for the DLL version of the LIBCURL library from curl
;

LIBRARY LIBCURL

DESCRIPTION 'curl libcurl - http://curl.haxx.se'

EXPORTS
        curl_easy_cleanup @ 1 ;
        curl_easy_getinfo @ 2 ;
        curl_easy_init @ 3 ;
        curl_easy_perform @ 4 ;
        curl_easy_setopt @ 5 ;
        curl_escape @ 6 ;
        curl_unescape @ 7;
        curl_formfree @ 9 ;
        curl_getdate @ 10 ;
        curl_getenv @ 11 ;
        curl_global_cleanup @ 12 ;
        curl_global_init @ 13 ;
        curl_slist_append @ 14 ;
        curl_slist_free_all @ 15 ;
        curl_version @ 16 ;
        curl_maprintf @ 17 ;
        curl_mfprintf @ 18 ;
        curl_mprintf @ 19 ;
        curl_msprintf @ 20 ;
        curl_msnprintf @ 21 ;
        curl_mvfprintf @ 22 ;
        curl_strequal @ 23 ;
        curl_strnequal @ 24 ;
        curl_easy_duphandle @ 25 ;
        curl_formadd @ 26 ;
        curl_multi_init @ 27;
        curl_multi_add_handle @ 28;
        curl_multi_remove_handle @ 29;
        curl_multi_fdset @ 30;
        curl_multi_perform @ 31;
        curl_multi_cleanup @ 32;
        curl_multi_info_read @ 33;
        curl_free @ 34;
        curl_version_info @ 35;
        curl_share_init @ 36;
        curl_share_setopt @ 37;
        curl_share_cleanup @ 38;
        curl_global_init_mem @ 39;
        curl_easy_strerror @ 40;
        curl_multi_strerror @ 41;
        curl_share_strerror @ 42;
        curl_easy_reset @ 43;

#############################################################
#
# 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.
#
# $Id: Makefile.vc6,v 1.17 2004/01/13 08:57:01 bagder Exp $
##############################################################

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

!IFNDEF ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.1
!ENDIF

# Use the high resolution time by default. Comment this out to use low
# resolution time and not require winmm.lib
USEMM_LIBS = YES

#############################################################
## 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"
CFLAGSZLIB = /D "HAVE_ZLIB_H" /D "HAVE_ZLIB" /D "HAVE_LIBZ" /I "$(ZLIB_PATH)"
CFLAGS = /I "." /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
SSLLIBS = libeay32.lib ssleay32.lib
ZLIBLIBSDLL= zdll.lib
ZLIBLIBS = zlib.lib
!IFDEF USEMM_LIBS
WINLIBS = wsock32.lib winmm.lib
!ELSE
WINLIBS = wsock32.lib
CFLAGS = $(CFLAGS) /D "WITHOUT_MM_LIB"
!ENDIF
# RSAglue.lib was formerly needed in the SSLLIBS
CFGSET = FALSE

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

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

######################
# release-zlib

!IF "$(CFG)" == "release-zlib"
TARGET =$(LIB_NAME).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

!IF "$(CFG)" == "release-dll"
TARGET =$(LIB_NAME).dll
DIROBJ =.\$(CFG)
LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:"$(DIROBJ)\$(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:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSSSL)
CFGSET = TRUE
!ENDIF

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

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

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

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

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

!IF "$(CFG)" == "release-zlib-dll"
TARGET =$(LIB_NAME).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

!IF "$(CFG)" == "release-ssl-dll-zlib-dll"
TARGET =$(LIB_NAME).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

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

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

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

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

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

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

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

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

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

######################
# debug-zlib

!IF "$(CFG)" == "debug-zlib"
TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

######################
# debug-ssl-zlib

!IF "$(CFG)" == "debug-ssl-zlib"
TARGET =$(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32"
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

!IF "$(CFG)" == "debug-ssl-dll"
TARGET =$(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
LNK = $(LNKLIB) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL)
CFGSET = TRUE
!ENDIF

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

!IF "$(CFG)" == "debug-zlib-dll"
TARGET =$(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

!IF "$(CFG)" == "debug-ssl-dll-zlib-dll"
TARGET =$(LIB_NAME_DEBUG).lib
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
CFGSET = TRUE
!ENDIF

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

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

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

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

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

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

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

!IF "$(CFG)" == "debug-dll-ssl-dll-zlib-dll"
TARGET =$(LIB_NAME_DEBUG).dll
DIROBJ =.\$(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
LNK = $(LNKDLL) $(SSLLIBS) $(ZLIBLIBSDLL) $(WINLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:"$(DIROBJ)\$(LIB_NAME_DEBUG).lib" /PDB:"$(DIROBJ)\$(LIB_NAME_DEBUG).pdb"
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
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-ssl - release static library with ssl
!MESSAGE release-zlib - release static library with zlib
!MESSAGE release-ssl-zlib - release static library with ssl and zlib
!MESSAGE release-ssl-dll - release static library with shared ssl
!MESSAGE release-zlib-dll - release static library with shared zlib
!MESSAGE release-ssl-dll-zlib-dll - release static library with shared ssl and shared zlib
!MESSAGE release-dll - release shared library
!MESSAGE release-dll-ssl-dll - release shared library with dynamic ssl
!MESSAGE release-dll-zlib-dll - release shared library with dynamic zlib1
!MESSAGE release-dll-ssl-dll-zlib-dll - release shared library with dynamic ssl and dynamic zlib
!MESSAGE debug - debug static library
!MESSAGE debug-ssl - debug static library with ssl
!MESSAGE debug-zlib - debug static library with zlib
!MESSAGE debug-ssl-zlib - debug static library with ssl and zlib
!MESSAGE debug-ssl-dll - debug static library with shared ssl
!MESSAGE debug-zlib-dll - debug static library with shared zlib
!MESSAGE debug-ssl-dll-zlib-dll - debug static library with shared ssl and shared zlib
!MESSAGE debug-dll - debug shared library
!MESSAGE debug-dll-ssl-dll - debug shared library with dynamic ssl
!MESSAGE debug-dll-zlib-dll - debug shared library with dynamic zlib1
!MESSAGE debug-dll-ssl-dll-zlib-dll - debug shared library with dynamic ssl and dynamic zlib
!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)\parsedate.obj \
        $(DIROBJ)\getenv.obj \
        $(DIROBJ)\inet_pton.obj \
        $(DIROBJ)\hostip.obj \
        $(DIROBJ)\hostasyn.obj \
        $(DIROBJ)\hostsyn.obj \
        $(DIROBJ)\hostares.obj \
        $(DIROBJ)\hostthre.obj \
        $(DIROBJ)\hostip4.obj \
        $(DIROBJ)\hostip6.obj \
        $(DIROBJ)\inet_ntop.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)\strtoofft.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 \
        $(DIROBJ)\memdebug.obj \
        $(DIROBJ)\strerror.obj \
        $(DIROBJ)\select.obj \
        $(DIROBJ)\content_encoding.obj \
        $(RESOURCE)

all : $(TARGET)

$(TARGET): $(X_OBJS)
        $(LNK) $(LFLAGS) $(X_OBJS)
        xcopy $(DIROBJ)\*.dll . /y
        xcopy $(DIROBJ)\*.lib . /y
        xcopy $(DIROBJ)\*.exp . /y
        xcopy $(DIROBJ)\*.pdb . /y

$(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-dll-ssl-dll\libcurl.res \
debug-dll-zlib-dll\libcurl.res \
debug-dll-ssl-dll-zlib-dll\libcurl.res: libcurl.rc
        rc /dCURLDEBUG=1 /Fo $@ libcurl.rc

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

clean:
        @erase $(DIROBJ)\*.obj
        @erase $(DIROBJ)\*.res
        @erase $(DIROBJ)\*.pdb
        @erase $(DIROBJ)\*.lib
        @erase $(DIROBJ)\*.dll
        @erase $(DIROBJ)\*.exp

distrib: clean
  @erase *.lib
  @erase *.dll
  @erase *.exp
  @erase *.pdb
        @erase vc60.idb
        @erase vc60.pch

########################################################
## Makefile for building curl.exe with MSVC6
## Use: nmake -f makefile.vc6 [release | debug] [CFG=release-ssl]
## (default is release)
## "nmake -f makefile.vc6 CFG=release-ssl" statically links OpenSSL
## into curl.exe producing a standalone SSL-enabled executable.
##
## Comments to: Troy Engel <tengel_at_sonic.net>
## Updated by: Craig Davison <cd_at_securityfocus.com>
## release-ssl added by Miklos Nemeth <mnemeth_at_kfkisystems.com>
## winmm.lib added by Miklos Nemeth <mnemeth_at_kfkisystems.com> to support
## timeGetTime() in timeval.c

PROGRAM_NAME = curl.exe

!IFNDEF ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.1
!ENDIF

!IFNDEF OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.7e
!ENDIF

########################################################
## Nothing more to do below this line!
CFLAGSZLIB = /D "HAVE_ZLIB_H" /D "HAVE_ZLIB" /D "HAVE_LIBZ" /I "$(ZLIB_PATH)"
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
ZLIBLIBS = zlib.lib
ZLIBLIBSDLL = zdll.lib
SSLINC = /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
CFLAGSSSL = /D "USE_SSLEAY"
LFLAGSSSL = /LIBPATH:"$(OPENSSL_PATH)/out32"
LFLAGSSSLDLL = /LIBPATH:"$(OPENSSL_PATH)/out32dll"
SSLLIBS = libeay32.lib ssleay32.lib gdi32.lib

## Release
CCR = cl.exe /MD /O2 /D "NDEBUG"
LINKR = link.exe /incremental:no /libpath:"../lib"
RCR = rc.exe /dCURLDEBUG=0

## Debug
CCD = cl.exe /MDd /Gm /ZI /Od /D "_DEBUG" /GZ
LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
RCD = rc.exe /dCURLDEBUG=1

CFLAGS = /I "../lib" /I "../include" /nologo /W3 /GX /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
LFLAGS = /nologo /out:$(PROGRAM_NAME) /subsystem:console /machine:I386
RESFLAGS = /i "../include"
LINKLIBS = wsock32.lib libcurl.lib winmm.lib
LINKLIBS_DEBUG = wsock32.lib libcurld.lib winmm.lib

RELEASE_OBJS= \
        hugehelpr.obj \
        writeoutr.obj \
        urlglobr.obj \
        getpassr.obj \
        homedirr.obj \
        timevalr.obj \
        strtoofftr.obj \
        mainr.obj \
        curlr.res

DEBUG_OBJS= \
        hugehelpd.obj \
        writeoutd.obj \
        urlglobd.obj \
        getpassd.obj \
        homedird.obj \
        timevald.obj \
        strtoofftd.obj \
        maind.obj \
        curld.res

######################
# release-ssl
 
!IF "$(CFG)" == "release-ssl"
CFLAGS = $(CFLAGS) $(CFLAGSSSL)
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(SSLLIBS)
LFLAGS = $(LFLAGS) $(LFLAGSSSL)
!ENDIF

######################
# release-zlib

!IF "$(CFG)" == "release-zlib"
CFLAGS = $(CFLAGS) $(CFLAGSZLIB)
LINKLIBS = $(LINKLIBS) $(ZLIBLIBS)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(ZLIBLIBS)
LFLAGS = $(LFLAGS) $(LFLAGSZLIB)
!ENDIF

######################
# release-ssl-zlib
 
!IF "$(CFG)" == "release-ssl-zlib"
CFLAGS = $(CFLAGS) $(CFLAGSSSL) $(CFLAGSZLIB)
LINKLIBS = $(LINKLIBS) $(SSLLIBS) $(ZLIBLIBS)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(SSLLIBS) $(ZLIBLIBS)
LFLAGS = $(LFLAGS) $(LFLAGSSSL) $(LFLAGSZLIB)
!ENDIF

######################
# release-ssl-dll
 
!IF "$(CFG)" == "release-ssl-dll"
CFLAGS = $(CFLAGS) $(CFLAGSSSL)
LINKLIBS = $(LINKLIBS) $(SSLLIBS)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(SSLLIBS)
LFLAGS = $(LFLAGS) $(LFLAGSSSLDLL)
!ENDIF

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

!IF "$(CFG)" == "release-zlib-dll"
CFLAGS = $(CFLAGS) $(CFLAGSZLIB)
LINKLIBS = $(LINKLIBS) $(ZLIBLIBSDLL)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(ZLIBLIBSDLL)
LFLAGS = $(LFLAGS) $(LFLAGSZLIB)
!ENDIF

######################
# release-ssl-dll-zlib-dll
 
!IF "$(CFG)" == "release-ssl-dll-zlib-dll"
CFLAGS = $(CFLAGS) $(CFLAGSSSL) $(CFLAGSZLIB)
LINKLIBS = $(LINKLIBS) $(SSLLIBS) $(ZLIBLIBSDLL)
LINKLIBS_DEBUG = $(LINKLIBS_DEBUG) $(SSLLIBS) $(ZLIBLIBSDLL)
LFLAGS = $(LFLAGS) $(LFLAGSSSLDLL) $(LFLAGSZLIB)
!ENDIF

all : release

release: $(RELEASE_OBJS)
        $(LINKR) $(LFLAGS) $(LINKLIBS) $(RELEASE_OBJS)

debug: $(DEBUG_OBJS)
        $(LINKD) $(LFLAGS) $(LINKLIBS_DEBUG) $(DEBUG_OBJS)

## Release
hugehelpr.obj: hugehelp.c
        $(CCR) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c
writeoutr.obj: writeout.c
        $(CCR) $(CFLAGS) /Fo"$@" writeout.c
urlglobr.obj: urlglob.c
        $(CCR) $(CFLAGS) /Fo"$@" urlglob.c
getpassr.obj: getpass.c
        $(CCR) $(CFLAGS) /Fo"$@" getpass.c
homedirr.obj: homedir.c
        $(CCR) $(CFLAGS) /Fo"$@" homedir.c
timevalr.obj: ../lib/timeval.c
        $(CCR) $(CFLAGS) /Fo"$@" ../lib/timeval.c
strtoofftr.obj: ../lib/strtoofft.c
        $(CCR) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c
mainr.obj: main.c
        $(CCR) $(CFLAGS) /Fo"$@" main.c
curlr.res : curl.rc
        $(RCR) $(RESFLAGS) /Fo"$@" curl.rc

## Debug
hugehelpd.obj: hugehelp.c
        $(CCD) $(CFLAGS) /Zm200 /Fo"$@" hugehelp.c
writeoutd.obj: writeout.c
        $(CCD) $(CFLAGS) /Fo"$@" writeout.c
urlglobd.obj: urlglob.c
        $(CCD) $(CFLAGS) /Fo"$@" urlglob.c
getpassd.obj: getpass.c
        $(CCD) $(CFLAGS) /Fo"$@" getpass.c
homedird.obj: homedir.c
        $(CCD) $(CFLAGS) /Fo"$@" homedir.c
timevald.obj: ../lib/timeval.c
        $(CCD) $(CFLAGS) /Fo"$@" ../lib/timeval.c
strtoofftd.obj: ../lib/strtoofft.c
        $(CCD) $(CFLAGS) /Fo"$@" ../lib/strtoofft.c
maind.obj: main.c
        $(CCD) $(CFLAGS) /Fo"$@" main.c
curld.res : curl.rc
        $(RCD) $(RESFLAGS) /Fo"$@" curl.rc

clean:
        -_at_erase $(RELEASE_OBJS)
        -_at_erase $(DEBUG_OBJS)
        -_at_erase vc60.idb
        -_at_erase vc60.pdb
        -_at_erase vc60.pch
        -_at_erase vc70.idb
        -_at_erase vc70.pch
        -_at_erase curl.ilk
        -_at_erase curl.pdb

distrib: clean
        -_at_erase $(PROGRAM_NAME)
Received on 2005-01-25