Skip to content
Snippets Groups Projects
Makefile.vc6 6.94 KiB
Newer Older
  • Learn to ignore specific revisions
  • #############################################################
    
    # Makefile for building libcurl with MSVC6
    #
    # Usage: see usage message below
    #        Should be invoked from \lib directory
    #        Edit the paths and desired library name
    
    sm's avatar
    sm committed
    #        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
    
    sm's avatar
    sm committed
    # in \src would need to be changed.
    #
    
    ##############################################################
    
    sm's avatar
    sm committed
    # CHANGE LOG
    
    # ------------------------------------------------------------
    # 05.11.2001   John Lask   Initial Release
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    # 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
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    !IFNDEF OPENSSL_PATH
    
    OPENSSL_PATH   = ../../openssl-0.9.7a
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    !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 "." /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
    
    LFLAGS    = /nologo
    
    SSLLIBS   = libeay32.lib ssleay32.lib
    #  RSAglue.lib was formerly needed in the SSLLIBS
    
    CFGSET    = FALSE
    
    ######################
    # release
    
    
    sm's avatar
    sm committed
    !IF "$(CFG)" == "release"
    
    TARGET =$(LIB_NAME).lib
    DIROBJ =.\$(CFG)
    LNK    = $(LNKLIB) /out:$(TARGET)
    CC     = $(CCNODBG)
    CFGSET = TRUE
    !ENDIF
    
    ######################
    # release-dll
    
    
    sm's avatar
    sm committed
    !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
    
    sm's avatar
    sm committed
    
    
    sm's avatar
    sm committed
    !IF "$(CFG)" == "release-ssl"
    
    sm's avatar
    sm committed
    TARGET   =$(LIB_NAME).lib
    
    DIROBJ   =.\$(CFG)
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32"
    
    LNK      = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
    CC       = $(CCNODBG) $(CFLAGSSSL)
    
    sm's avatar
    sm committed
    CFGSET   = TRUE
    
    !ENDIF
    
    ######################
    # release-ssl-dll
    
    
    sm's avatar
    sm committed
    !IF "$(CFG)" == "release-ssl-dll"
    
    TARGET   =$(LIB_NAME).dll
    DIROBJ   =.\$(CFG)
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
    
    sm's avatar
    sm committed
    LNK      = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
    
    CC       = $(CCNODBG)  $(CFLAGSSSL)
    
    sm's avatar
    sm committed
    CFGSET   = TRUE
    
    RESOURCE = $(DIROBJ)\libcurl.res
    
    ######################
    # 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)
    CC       = $(CCNODBG)  $(CFLAGSSSL)
    CFGSET   = TRUE
    
    RESOURCE = $(DIROBJ)\libcurl.res
    
    ######################
    # debug
    
    
    sm's avatar
    sm committed
    !IF "$(CFG)" == "debug"
    
    TARGET =$(LIB_NAME_DEBUG).lib
    DIROBJ =.\$(CFG)
    LNK    = $(LNKLIB) /out:$(TARGET)
    CC     = $(CCDEBUG)
    CFGSET = TRUE
    !ENDIF
    
    ######################
    # debug-dll
    
    
    sm's avatar
    sm committed
    !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
    
    sm's avatar
    sm committed
    !IF "$(CFG)" == "debug-ssl"
    
    TARGET   = $(LIB_NAME_DEBUG).lib
    DIROBJ   =.\$(CFG)
    LNK      = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
    CC       = $(CCDEBUG) $(CFLAGSSSL)
    CFGSET   = TRUE
    !ENDIF
    
    ######################
    # debug-ssl-dll
    
    
    sm's avatar
    sm committed
    !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"
    
    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)\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 \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	$(DIROBJ)\strtok.obj \
    
    	$(DIROBJ)\strtoofft.obj \
    
    sm's avatar
    sm committed
    	$(DIROBJ)\connect.obj \
    	$(DIROBJ)\hash.obj \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	$(DIROBJ)\llist.obj \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	$(DIROBJ)\share.obj \
    
    	$(DIROBJ)\multi.obj \
    	$(DIROBJ)\http_digest.obj \
    
            $(DIROBJ)\http_negotiate.obj \
            $(DIROBJ)\http_ntlm.obj \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	$(DIROBJ)\strerror.obj \
    
    
    all : $(TARGET)
    
    
    $(TARGET): $(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
    
    	-@erase $(DIROBJ)\*.obj
    
    	-@erase $(DIROBJ)\*.res
    
    sm's avatar
    sm committed
    	-@erase vc60.pch