1############################################################ 2# 3# Makefile.b32 - Borland's C++ Compiler 5.X 4# 5# 'lib' directory 6# 7# 'BCCDIR' has to be set up to point to the base directory 8# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55 9# 10# Initially written by Jaepil Kim, pit@paradise.net.nz 11############################################################ 12 13!if "$(__MAKE__)" == "" 14!error __MAKE__ not defined. Use Borlands's MAKE to process this makefile. 15!endif 16 17# Borland's $(MAKEDIR) expands to the path where make.exe is located, 18# use this feature to define BCCDIR when user has not defined BCCDIR. 19!ifndef BCCDIR 20BCCDIR = $(MAKEDIR)\.. 21!endif 22 23# Edit the path below to point to the base of your Zlib sources. 24!ifndef ZLIB_PATH 25ZLIB_PATH = ..\..\zlib-1.2.8 26!endif 27 28# Edit the path below to point to the base of your OpenSSL package. 29!ifndef OPENSSL_PATH 30OPENSSL_PATH = ..\..\openssl-1.0.2a 31!endif 32 33# Set libcurl static lib, dll and import lib 34LIBCURL_LIB = libcurl.lib 35LIBCURL_DLL = libcurl.dll 36LIBCURL_IMPLIB = libcurl_imp.lib 37 38# Setup environment 39PP_CMD = cpp32 -q -P- 40CC_CMD = bcc32 -q -c 41LD = bcc32 42RM = del 2>NUL 43MKDIR = md 44RMDIR = rd /q 45LIB = tlib 46IMPLIB = implib 47 48CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -w-inl -w-pia -w-pin -Dinline=__inline 49LIBFLAGS = /C /P32 50LDFLAGS = -q -lq -laa -tWD 51 52SRCDIR = .;.\vtls 53OBJDIR = .\BCC_objs 54INCDIRS = -I.;.\lib;..\include 55LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib 56DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL 57 58# By default SSPI support is enabled for BCC 59!ifndef DISABLE_SSPI 60DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI 61!endif 62 63# By default LDAP support is disabled for BCC 64!ifndef WITH_LDAP 65DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP 66!endif 67 68# ZLIB support is enabled setting WITH_ZLIB=1 69!ifdef WITH_ZLIB 70DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H 71INCDIRS = $(INCDIRS);$(ZLIB_PATH) 72LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib 73!endif 74 75# SSL support is enabled setting WITH_SSL=1 76!ifdef WITH_SSL 77DEFINES = $(DEFINES) -DUSE_OPENSSL 78INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl 79LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib 80!endif 81 82.autodepend 83 84.path.c = $(SRCDIR) 85.path.obj = $(OBJDIR) 86.path.int = $(OBJDIR) 87 88# Makefile.inc provides the CSOURCES and HHEADERS defines 89!include Makefile.inc 90 91# Borland's command line librarian program TLIB version 4.5 is not capable 92# of building a library when any of its objects contains an hypen in its 93# name, due to a command line parsing bug. In order to workaround this, we 94# build source files with hyphens in their name as objects with underscores 95# using explicit compilation build rules instead of implicit ones. 96 97NOHYPHEN1 = $(CSOURCES:-=_) 98NOHYPHEN2 = $(NOHYPHEN1:vtls/=) 99 100OBJECTS = $(NOHYPHEN2:.c=.obj) 101PREPROCESSED = $(NOHYPHEN2:.c=.int) 102 103# Borland's command line compiler (BCC32) version 5.5.1 integrated 104# preprocessor has a bug which results in silently generating wrong 105# definitions for libcurl macros such as CURL_OFF_T_C, on the other 106# hand Borland's command line preprocessor (CPP32) version 5.5.1 does 107# not have the bug and achieves proper results. In order to avoid the 108# silent bug we first preprocess source files and later compile the 109# preprocessed result. 110 111.c.obj: 112 @-$(RM) $(@R).int 113 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<) 114 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int 115 116all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL) 117 118asyn_ares.obj: asyn-ares.c 119 @-$(RM) $(@R).int 120 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) 121 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int 122 123asyn_thread.obj: asyn-thread.c 124 @-$(RM) $(@R).int 125 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) 126 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int 127 128non_ascii.obj: non-ascii.c 129 @-$(RM) $(@R).int 130 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) 131 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int 132 133clean: 134 cd $(OBJDIR) 135 @-$(RM) $(OBJECTS) 136 @-$(RM) $(PREPROCESSED) 137 cd .. 138 @-$(RMDIR) $(OBJDIR) 139 @-$(RM) $(LIBCURL_LIB) 140 @-$(RM) $(LIBCURL_IMPLIB) 141 @-$(RM) libcurl.tds 142 143$(OBJDIR): 144 @-$(RMDIR) $(OBJDIR) 145 @-$(MKDIR) $(OBJDIR) 146 147$(LIBCURL_LIB): $(OBJECTS) 148 @-$(RM) $(LIBCURL_LIB) 149 $(LIB) $(LIBFLAGS) $@ @&&! 150+$(**: = &^ 151+) 152! 153 154$(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB) 155 @-$(RM) $(LIBCURL_DLL) 156 @-$(RM) $(LIBCURL_IMPLIB) 157 $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&! 158$(**: = ^ 159) 160! 161 $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL) 162 163 164# End of Makefile.b32 165