From f5ba174f4d04524b2d48fad9d1f0954a33ec2df5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Nov 2001 11:56:26 +0000 Subject: [PATCH] John Lask's new makefile --- lib/Makefile.vc6 | 576 ++++++++++++++++++++----------------------------------- 1 file changed, 208 insertions(+), 368 deletions(-) diff --git a/lib/Makefile.vc6 b/lib/Makefile.vc6 index 25481a7..b28f77d 100644 --- a/lib/Makefile.vc6 +++ b/lib/Makefile.vc6 @@ -1,377 +1,217 @@ ############################################################# # -## Makefile for building libcurl.lib with MSVC6 -## Use: nmake -f makefile.vc6 [release | release-ssl | debug] -## (default is release) -## -## Originally written by: Troy Engel -## Updated by: Craig Davison -## Updated by: SM - -PROGRAM_NAME = libcurl.lib -PROGRAM_NAME_DEBUG = libcurld.lib -#OPENSSL_PATH = ../../openssl-0.9.6b - -######################################################## -## Nothing more to do below this line! - -## Release -CCR = cl.exe /MD /O2 /D "NDEBUG" -LINKR = link.exe -lib /out:$(PROGRAM_NAME) +# 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 +# +# +############################################################## -## Debug -CCD = cl.exe /MDd /Gm /ZI /Od /D "_DEBUG" /GZ -LINKD = link.exe -lib /out:$(PROGRAM_NAME_DEBUG) +LIB_NAME = libcurl +LIB_NAME_DEBUG = libcurl +OPENSSL_PATH = ../../openssl-0.9.6 -## SSL Release -CCRS = cl.exe /MD /O2 /D "NDEBUG" /D "USE_SSLEAY" /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl" -LINKRS = link.exe -lib /out:$(PROGRAM_NAME) /LIBPATH:$(OPENSSL_PATH)/out32dll +############################################################# +## 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" -LFLAGS = /nologo -LINKLIBS = ws2_32.lib -LINKSLIBS = libeay32.lib ssleay32.lib RSAglue.lib - -RELEASE_OBJS= \ - base64r.obj \ - cookier.obj \ - transferr.obj \ - escaper.obj \ - formdatar.obj \ - ftpr.obj \ - httpr.obj \ - http_chunksr.obj \ - ldapr.obj \ - dictr.obj \ - telnetr.obj \ - getdater.obj \ - getenvr.obj \ - getpassr.obj \ - hostipr.obj \ - if2ipr.obj \ - mprintfr.obj \ - netrcr.obj \ - progressr.obj \ - sendfr.obj \ - speedcheckr.obj \ - ssluser.obj \ - timevalr.obj \ - urlr.obj \ - filer.obj \ - getinfor.obj \ - versionr.obj \ - easyr.obj \ - strequalr.obj \ - strtokr.obj \ - connectr.obj - -DEBUG_OBJS= \ - base64d.obj \ - cookied.obj \ - transferd.obj \ - escaped.obj \ - formdatad.obj \ - ftpd.obj \ - httpd.obj \ - http_chunksd.obj \ - ldapd.obj \ - dictd.obj \ - telnetd.obj \ - getdated.obj \ - getenvd.obj \ - getpassd.obj \ - hostipd.obj \ - if2ipd.obj \ - mprintfd.obj \ - netrcd.obj \ - progressd.obj \ - sendfd.obj \ - speedcheckd.obj \ - sslused.obj \ - timevald.obj \ - urld.obj \ - filed.obj \ - getinfod.obj \ - versiond.obj \ - easyd.obj \ - strequald.obj \ - strtokd.obj \ - connectd.obj - -RELEASE_SSL_OBJS= \ - base64rs.obj \ - cookiers.obj \ - transferrs.obj \ - escapers.obj \ - formdatars.obj \ - ftprs.obj \ - httprs.obj \ - http_chunksrs.obj \ - ldaprs.obj \ - dictrs.obj \ - telnetrs.obj \ - getdaters.obj \ - getenvrs.obj \ - getpassrs.obj \ - hostiprs.obj \ - if2iprs.obj \ - mprintfrs.obj \ - netrcrs.obj \ - progressrs.obj \ - sendfrs.obj \ - speedcheckrs.obj \ - sslusers.obj \ - timevalrs.obj \ - urlrs.obj \ - filers.obj \ - getinfors.obj \ - versionrs.obj \ - easyrs.obj \ - strequalrs.obj \ - strtokrs.obj \ - connectrs.obj - -LINK_OBJS= \ - base64.obj \ - cookie.obj \ - transfer.obj \ - escape.obj \ - formdata.obj \ - ftp.obj \ - http.obj \ - http_chunks.obj \ - ldap.obj \ - dict.obj \ - telnet.obj \ - getdate.obj \ - getenv.obj \ - getpass.obj \ - hostip.obj \ - if2ip.obj \ - mprintf.obj \ - netrc.obj \ - progress.obj \ - sendf.obj \ - speedcheck.obj \ - ssluse.obj \ - timeval.obj \ - url.obj \ - file.obj \ - getinfo.obj \ - version.obj \ - easy.obj \ - strequal.obj \ - strtok.obj \ - connect.obj - -all : release - -release: $(RELEASE_OBJS) - $(LINKR) $(LFLAGS) $(LINKLIBS) $(LINK_OBJS) - -debug: $(DEBUG_OBJS) - $(LINKD) $(LFLAGS) $(LINKLIBS) $(LINK_OBJS) - -release-ssl: $(RELEASE_SSL_OBJS) - $(LINKRS) $(LFLAGS) $(LINKLIBS) $(LINKSLIBS) $(LINK_OBJS) - -## Release -base64r.obj: base64.c - $(CCR) $(CFLAGS) base64.c -cookier.obj: cookie.c - $(CCR) $(CFLAGS) cookie.c -transferr.obj: transfer.c - $(CCR) $(CFLAGS) transfer.c -escaper.obj: escape.c - $(CCR) $(CFLAGS) escape.c -formdatar.obj: formdata.c - $(CCR) $(CFLAGS) formdata.c -ftpr.obj: ftp.c - $(CCR) $(CFLAGS) ftp.c -httpr.obj: http.c - $(CCR) $(CFLAGS) http.c -http_chunksr.obj: http_chunks.c - $(CCR) $(CFLAGS) http_chunks.c -ldapr.obj: ldap.c - $(CCR) $(CFLAGS) ldap.c -dictr.obj: dict.c - $(CCR) $(CFLAGS) dict.c -telnetr.obj: telnet.c - $(CCR) $(CFLAGS) telnet.c -getdater.obj: getdate.c - $(CCR) $(CFLAGS) getdate.c -getenvr.obj: getenv.c - $(CCR) $(CFLAGS) getenv.c -getpassr.obj: getpass.c - $(CCR) $(CFLAGS) getpass.c -hostipr.obj: hostip.c - $(CCR) $(CFLAGS) hostip.c -if2ipr.obj: if2ip.c - $(CCR) $(CFLAGS) if2ip.c -mprintfr.obj: mprintf.c - $(CCR) $(CFLAGS) mprintf.c -netrcr.obj: netrc.c - $(CCR) $(CFLAGS) netrc.c -progressr.obj: progress.c - $(CCR) $(CFLAGS) progress.c -sendfr.obj: sendf.c - $(CCR) $(CFLAGS) sendf.c -speedcheckr.obj: speedcheck.c - $(CCR) $(CFLAGS) speedcheck.c -ssluser.obj: ssluse.c - $(CCR) $(CFLAGS) ssluse.c -timevalr.obj: timeval.c - $(CCR) $(CFLAGS) timeval.c -urlr.obj: url.c - $(CCR) $(CFLAGS) url.c -filer.obj: file.c - $(CCR) $(CFLAGS) file.c -getinfor.obj: getinfo.c - $(CCR) $(CFLAGS) getinfo.c -versionr.obj: version.c - $(CCR) $(CFLAGS) version.c -easyr.obj: easy.c - $(CCR) $(CFLAGS) easy.c -strequalr.obj: strequal.c - $(CCR) $(CFLAGS) strequal.c -strtokr.obj:strtok.c - $(CCR) $(CFLAGS) strtok.c -connectr.obj:connect.c - $(CCR) $(CFLAGS) connect.c - -## Debug -base64d.obj: base64.c - $(CCD) $(CFLAGS) base64.c -cookied.obj: cookie.c - $(CCD) $(CFLAGS) cookie.c -transferd.obj: transfer.c - $(CCD) $(CFLAGS) transfer.c -escaped.obj: escape.c - $(CCD) $(CFLAGS) escape.c -formdatad.obj: formdata.c - $(CCD) $(CFLAGS) formdata.c -ftpd.obj: ftp.c - $(CCD) $(CFLAGS) ftp.c -httpd.obj: http.c - $(CCD) $(CFLAGS) http.c -http_chunksd.obj: http_chunks.c - $(CCD) $(CFLAGS) http_chunks.c -ldapd.obj: ldap.c - $(CCD) $(CFLAGS) ldap.c -dictd.obj: dict.c - $(CCD) $(CFLAGS) dict.c -telnetd.obj: telnet.c - $(CCD) $(CFLAGS) telnet.c -getdated.obj: getdate.c - $(CCD) $(CFLAGS) getdate.c -getenvd.obj: getenv.c - $(CCD) $(CFLAGS) getenv.c -getpassd.obj: getpass.c - $(CCD) $(CFLAGS) getpass.c -hostipd.obj: hostip.c - $(CCD) $(CFLAGS) hostip.c -if2ipd.obj: if2ip.c - $(CCD) $(CFLAGS) if2ip.c -mprintfd.obj: mprintf.c - $(CCD) $(CFLAGS) mprintf.c -netrcd.obj: netrc.c - $(CCD) $(CFLAGS) netrc.c -progressd.obj: progress.c - $(CCD) $(CFLAGS) progress.c -sendfd.obj: sendf.c - $(CCD) $(CFLAGS) sendf.c -speedcheckd.obj: speedcheck.c - $(CCD) $(CFLAGS) speedcheck.c -sslused.obj: ssluse.c - $(CCD) $(CFLAGS) ssluse.c -timevald.obj: timeval.c - $(CCD) $(CFLAGS) timeval.c -urld.obj: url.c - $(CCD) $(CFLAGS) url.c -filed.obj: file.c - $(CCD) $(CFLAGS) file.c -getinfod.obj: getinfo.c - $(CCD) $(CFLAGS) getinfo.c -versiond.obj: version.c - $(CCD) $(CFLAGS) version.c -easyd.obj: easy.c - $(CCD) $(CFLAGS) easy.c -strequald.obj: strequal.c - $(CCD) $(CFLAGS) strequal.c -strtokd.obj:strtok.c - $(CCD) $(CFLAGS) strtok.c -connectd.obj:connect.c - $(CCR) $(CFLAGS) connect.c - -## Release SSL -base64rs.obj: base64.c - $(CCRS) $(CFLAGS) base64.c -cookiers.obj: cookie.c - $(CCRS) $(CFLAGS) cookie.c -transferrs.obj: transfer.c - $(CCRS) $(CFLAGS) transfer.c -escapers.obj: escape.c - $(CCRS) $(CFLAGS) escape.c -formdatars.obj: formdata.c - $(CCRS) $(CFLAGS) formdata.c -ftprs.obj: ftp.c - $(CCRS) $(CFLAGS) ftp.c -httprs.obj: http.c - $(CCRS) $(CFLAGS) http.c -http_chunksrs.obj: http_chunks.c - $(CCRS) $(CFLAGS) http_chunks.c -ldaprs.obj: ldap.c - $(CCRS) $(CFLAGS) ldap.c -dictrs.obj: dict.c - $(CCRS) $(CFLAGS) dict.c -telnetrs.obj: telnet.c - $(CCRS) $(CFLAGS) telnet.c -getdaters.obj: getdate.c - $(CCRS) $(CFLAGS) getdate.c -getenvrs.obj: getenv.c - $(CCRS) $(CFLAGS) getenv.c -getpassrs.obj: getpass.c - $(CCRS) $(CFLAGS) getpass.c -hostiprs.obj: hostip.c - $(CCRS) $(CFLAGS) hostip.c -if2iprs.obj: if2ip.c - $(CCRS) $(CFLAGS) if2ip.c -mprintfrs.obj: mprintf.c - $(CCRS) $(CFLAGS) mprintf.c -netrcrs.obj: netrc.c - $(CCRS) $(CFLAGS) netrc.c -progressrs.obj: progress.c - $(CCRS) $(CFLAGS) progress.c -sendfrs.obj: sendf.c - $(CCRS) $(CFLAGS) sendf.c -speedcheckrs.obj: speedcheck.c - $(CCRS) $(CFLAGS) speedcheck.c -sslusers.obj: ssluse.c - $(CCRS) $(CFLAGS) ssluse.c -timevalrs.obj: timeval.c - $(CCRS) $(CFLAGS) timeval.c -urlrs.obj: url.c - $(CCRS) $(CFLAGS) url.c -filers.obj: file.c - $(CCRS) $(CFLAGS) file.c -getinfors.obj: getinfo.c - $(CCRS) $(CFLAGS) getinfo.c -versionrs.obj: version.c - $(CCRS) $(CFLAGS) version.c -easyrs.obj: easy.c - $(CCRS) $(CFLAGS) easy.c -strequalrs.obj: strequal.c - $(CCRS) $(CFLAGS) strequal.c -strtokrs.obj:strtok.c - $(CCRS) $(CFLAGS) strtok.c -connectrs.obj:connect.c - $(CCR) $(CFLAGS) connect.c + +LNKDLL = link.exe /DLL /def:libcurl.def +LNKLIB = link.exe -lib +LFLAGS = /nologo +LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll +LINKLIBS = ws2_32.lib +SSLLIBS = libeay32.lib ssleay32.lib RSAglue.lib +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 +!ENDIF + +###################### +# release-ssl +#todo +!IF "$(CFG)" == "release-ssl" +TARGET =$(LIB_NAME).dll +DIROBJ =.\$(CFG) +LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET) +LINKLIBS = $(LINKLIBS) $(SSLLIBS) +CC = $(CCNODBG) $(CFLAGSSSL) +CFGSET = TRUE +!ENDIF + +###################### +# release-ssl-dll + +!IF "$(CFG)" == "release-ssl-dll" +TARGET =$(LIB_NAME).dll +DIROBJ =.\$(CFG) +LNK = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib" +LINKLIBS = $(LINKLIBS) $(SSLLIBS) +CC = $(CCNODBG) $(CFLAGSSSL) +CFGSET = TRUE +!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) /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" +CC = $(CCDEBUG) +CFGSET = TRUE +!ENDIF + +###################### +# debug-ssl +#todo +!IF "$(CFG)" == "debug-ssl" +TARGET = $(LIB_NAME_DEBUG).lib +DIROBJ =.\$(CFG) +LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET) +LINKLIBS = $(LINKLIBS) $(SSLLIBS) +CC = $(CCDEBUG) $(CFLAGSSSL) +CFGSET = TRUE +!ENDIF + +###################### +# debug-ssl-dll + +!IF "$(CFG)" == "debug-ssl-dll" +TARGET =$(LIB_NAME_DEBUG).dll +DIROBJ =.\$(CFG) +LNK = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" +LINKLIBS = $(LINKLIBS) $(SSLLIBS) +CC = $(CCDEBUG) $(CFLAGSSSL) +CFGSET = TRUE +!ENDIF + +####################### +# Usage +# +!IF "$(CFGSET)" == "FALSE" +!MESSAGE Usage: nmake -f makefile.vc6 CFG= +!MESSAGE where 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 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 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)\getpass.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 + + +all : $(TARGET) + + +$(TARGET): $(X_OBJS) + $(LNK) $(LFLAGS) $(LINKLIBS) $(X_OBJS) + +$(X_OBJS): $(DIROBJ) + +$(DIROBJ): + @if not exist "$(DIROBJ)" mkdir $(DIROBJ) + +.SUFFIXES: .c .obj + +{.\}.c{$(DIROBJ)\}.obj: + $(CC) $(CFLAGS) /Fo"$@" $< clean: - -@erase *.obj + -@erase $(DIROBJ)\*.obj -@erase vc60.idb - -@erase vc60.pch - -distrib: clean - -@erase $(PROGRAM_NAME) - + -@erase vc60.pch \ No newline at end of file -- 2.7.4