1 ############################################################
3 # Makefile.b32 - Borland's C++ Compiler 5.X
7 # 'BCCDIR' has to be set up to point to the base directory
8 # of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
10 # Initially written by Jaepil Kim, pit@paradise.net.nz
11 ############################################################
13 !if "$(__MAKE__)" == ""
14 !error __MAKE__ not defined. Use Borlands's MAKE to process this makefile.
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.
20 BCCDIR = $(MAKEDIR)\..
23 # Edit the path below to point to the base of your Zlib sources.
25 ZLIB_PATH = ..\..\zlib-1.2.8
28 # Edit the path below to point to the base of your OpenSSL package.
30 OPENSSL_PATH = ..\..\openssl-1.0.2a
33 # Set libcurl static lib, dll and import lib
34 LIBCURL_LIB = libcurl.lib
35 LIBCURL_DLL = libcurl.dll
36 LIBCURL_IMPLIB = libcurl_imp.lib
48 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
50 LDFLAGS = -q -lq -laa -tWD
54 INCDIRS = -I.;.\lib;..\include
55 LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
56 DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
58 # By default SSPI support is enabled for BCC
60 DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI
63 # By default LDAP support is disabled for BCC
65 DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP
68 # ZLIB support is enabled setting WITH_ZLIB=1
70 DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
71 INCDIRS = $(INCDIRS);$(ZLIB_PATH)
72 LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
75 # SSL support is enabled setting WITH_SSL=1
77 DEFINES = $(DEFINES) -DUSE_OPENSSL
78 INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
79 LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
88 # Makefile.inc provides the CSOURCES and HHEADERS defines
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.
97 NOHYPHEN1 = $(CSOURCES:-=_)
98 NOHYPHEN2 = $(NOHYPHEN1:vtls/=)
100 OBJECTS = $(NOHYPHEN2:.c=.obj)
101 PREPROCESSED = $(NOHYPHEN2:.c=.int)
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.
113 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
114 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
116 all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
118 asyn_ares.obj: asyn-ares.c
120 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
121 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
123 asyn_thread.obj: asyn-thread.c
125 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
126 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
128 non_ascii.obj: non-ascii.c
130 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
131 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
136 @-$(RM) $(PREPROCESSED)
139 @-$(RM) $(LIBCURL_LIB)
140 @-$(RM) $(LIBCURL_IMPLIB)
147 $(LIBCURL_LIB): $(OBJECTS)
148 @-$(RM) $(LIBCURL_LIB)
149 $(LIB) $(LIBFLAGS) $@ @&&!
154 $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
155 @-$(RM) $(LIBCURL_DLL)
156 @-$(RM) $(LIBCURL_IMPLIB)
157 $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
161 $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
164 # End of Makefile.b32