1 ############################################################ 2 # 3 # Makefile.b32 - Borland's C++ Compiler 5.X 4 # 5 # 'src' 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 (at] 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 20 BCCDIR = $(MAKEDIR)\.. 21 !endif 22 23 # Edit the path below to point to the base of your Zlib sources. 24 !ifndef ZLIB_PATH 25 ZLIB_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 30 OPENSSL_PATH = ..\..\openssl-1.0.2a 31 !endif 32 33 # Set program's name 34 PROGNAME = curl.exe 35 36 # Setup environment 37 PP_CMD = cpp32 -q -P- 38 CC_CMD = bcc32 -q -c 39 LD = bcc32 40 RM = del 2>NUL 41 MKDIR = md 42 RMDIR = rd /q 2>NUL 43 COPY = $(COMSPEC) /c copy /y 44 45 CC_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 46 LDFLAGS = -q -lq -lap 47 48 SRCDIRS = .;..\lib 49 OBJDIR = .\BCC_objs 50 INCDIRS = -I.;..\include;..\lib 51 LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib 52 DEFINES = -DNDEBUG -DWIN32 53 54 !ifdef DYNAMIC 55 LIBCURL_LIB = ..\lib\libcurl_imp.lib 56 !else 57 LIBCURL_LIB = ..\lib\libcurl.lib 58 DEFINES = $(DEFINES) -DCURL_STATICLIB 59 !endif 60 61 # ZLIB support is enabled setting WITH_ZLIB=1 62 !ifdef WITH_ZLIB 63 DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H 64 INCDIRS = $(INCDIRS);$(ZLIB_PATH) 65 LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib 66 !endif 67 68 # SSL support is enabled setting WITH_SSL=1 69 !ifdef WITH_SSL 70 DEFINES = $(DEFINES) -DUSE_OPENSSL 71 INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl 72 LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib 73 !endif 74 75 .autodepend 76 77 .path.c = $(SRCDIRS) 78 .path.obj = $(OBJDIR) 79 .path.int = $(OBJDIR) 80 81 # Makefile.inc provides the CSOURCES and HHEADERS defines 82 !include Makefile.inc 83 84 CSOURCES = $(CURL_CFILES) $(CURLX_CFILES:../lib/=) 85 OBJECTS = $(CSOURCES:.c=.obj) 86 PREPROCESSED = $(CSOURCES:.c=.int) 87 88 # Borland's command line compiler (BCC32) version 5.5.1 integrated 89 # preprocessor has a bug which results in silently generating wrong 90 # definitions for libcurl macros such as CURL_OFF_T_C, on the other 91 # hand Borland's command line preprocessor (CPP32) version 5.5.1 does 92 # not have the bug and achieves proper results. In order to avoid the 93 # silent bug we first preprocess source files and later compile the 94 # preprocessed result. 95 96 .c.obj: 97 @-$(RM) $(@R).int 98 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<) 99 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int 100 101 all: $(OBJDIR) tool_hugehelp $(PROGNAME) 102 103 clean: 104 cd $(OBJDIR) 105 @-$(RM) $(OBJECTS) 106 @-$(RM) $(PREPROCESSED) 107 cd .. 108 @-$(RMDIR) $(OBJDIR) 109 @-$(RM) $(PROGNAME) 110 @-$(RM) curl.tds 111 112 $(OBJDIR): 113 @-$(RMDIR) $(OBJDIR) 114 @-$(MKDIR) $(OBJDIR) 115 116 !ifdef WITH_ZLIB 117 tool_hugehelp: ..\docs\MANUAL ..\docs\curl.1 mkhelp.pl 118 groff -Tascii -man -P -c ../docs/curl.1 > tool_hugehelp.tmp 119 perl -w mkhelp.pl -c ../docs/MANUAL < tool_hugehelp.tmp > tool_hugehelp.c 120 @-$(RM) tool_hugehelp.tmp 121 !else 122 tool_hugehelp: 123 if exist ..\GIT-INFO $(COPY) tool_hugehelp.c.cvs tool_hugehelp.c 124 !endif 125 126 $(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB) 127 @-$(RM) $(PROGNAME) 128 $(LD) $(LDFLAGS) -e$@ @&&! 129 $(**: = ^ 130 ) 131 ! 132 133 134 # End of Makefile.b32 135