blob: 5b5b5fa9fc2cd0932f76d247a514c02197e62b53 [file] [log] [blame]
Alex Deymo8f1a2142016-06-28 14:49:26 -07001#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) 2000, Jaepil Kim, <pit@paradise.net.nz>.
9# Copyright (C) 2001 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.haxx.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22#***************************************************************************
23
Lucas Eckels9bd90e62012-08-06 15:07:02 -070024############################################################
25#
26# Makefile.b32 - Borland's C++ Compiler 5.X
27#
Lucas Eckels9bd90e62012-08-06 15:07:02 -070028# 'BCCDIR' has to be set up to point to the base directory
29# of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
Lucas Eckels9bd90e62012-08-06 15:07:02 -070030#
Lucas Eckels9bd90e62012-08-06 15:07:02 -070031############################################################
32
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070033!if "$(__MAKE__)" == ""
34!error __MAKE__ not defined. Use Borlands's MAKE to process this makefile.
35!endif
36
37# Borland's $(MAKEDIR) expands to the path where make.exe is located,
38# use this feature to define BCCDIR when user has not defined BCCDIR.
39!ifndef BCCDIR
40BCCDIR = $(MAKEDIR)\..
41!endif
42
Lucas Eckels9bd90e62012-08-06 15:07:02 -070043# Edit the path below to point to the base of your Zlib sources.
44!ifndef ZLIB_PATH
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070045ZLIB_PATH = ..\..\zlib-1.2.8
Lucas Eckels9bd90e62012-08-06 15:07:02 -070046!endif
47
48# Edit the path below to point to the base of your OpenSSL package.
49!ifndef OPENSSL_PATH
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070050OPENSSL_PATH = ..\..\openssl-1.0.2a
Lucas Eckels9bd90e62012-08-06 15:07:02 -070051!endif
52
53# Set libcurl static lib, dll and import lib
54LIBCURL_LIB = libcurl.lib
55LIBCURL_DLL = libcurl.dll
56LIBCURL_IMPLIB = libcurl_imp.lib
57
58# Setup environment
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070059PP_CMD = cpp32 -q -P-
60CC_CMD = bcc32 -q -c
Lucas Eckels9bd90e62012-08-06 15:07:02 -070061LD = bcc32
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070062RM = del 2>NUL
63MKDIR = md
64RMDIR = rd /q
Lucas Eckels9bd90e62012-08-06 15:07:02 -070065LIB = tlib
66IMPLIB = implib
67
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070068CC_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
Lucas Eckels9bd90e62012-08-06 15:07:02 -070069LIBFLAGS = /C /P32
70LDFLAGS = -q -lq -laa -tWD
71
Alex Deymo8f1a2142016-06-28 14:49:26 -070072SRCDIR = .;.\vauth;.\vtls
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070073OBJDIR = .\BCC_objs
74INCDIRS = -I.;.\lib;..\include
75LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
76DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
Lucas Eckels9bd90e62012-08-06 15:07:02 -070077
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070078# By default SSPI support is enabled for BCC
79!ifndef DISABLE_SSPI
80DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI
81!endif
Lucas Eckels9bd90e62012-08-06 15:07:02 -070082
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070083# By default LDAP support is disabled for BCC
84!ifndef WITH_LDAP
85DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP
86!endif
87
88# ZLIB support is enabled setting WITH_ZLIB=1
Lucas Eckels9bd90e62012-08-06 15:07:02 -070089!ifdef WITH_ZLIB
90DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
91INCDIRS = $(INCDIRS);$(ZLIB_PATH)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070092LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
Lucas Eckels9bd90e62012-08-06 15:07:02 -070093!endif
94
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070095# SSL support is enabled setting WITH_SSL=1
Lucas Eckels9bd90e62012-08-06 15:07:02 -070096!ifdef WITH_SSL
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070097DEFINES = $(DEFINES) -DUSE_OPENSSL
98INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
99LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700100!endif
101
102.autodepend
103
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700104.path.c = $(SRCDIR)
105.path.obj = $(OBJDIR)
106.path.int = $(OBJDIR)
107
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700108# Makefile.inc provides the CSOURCES and HHEADERS defines
109!include Makefile.inc
110
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700111# Borland's command line librarian program TLIB version 4.5 is not capable
Elliott Hughes82be86d2017-09-20 17:00:17 -0700112# of building a library when any of its objects contains an hyphen in its
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700113# name, due to a command line parsing bug. In order to workaround this, we
114# build source files with hyphens in their name as objects with underscores
115# using explicit compilation build rules instead of implicit ones.
116
117NOHYPHEN1 = $(CSOURCES:-=_)
Alex Deymo8f1a2142016-06-28 14:49:26 -0700118NOHYPHEN2 = $(NOHYPHEN1:vauth/=)
119NOHYPHEN3 = $(NOHYPHEN2:vtls/=)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700120
Alex Deymo8f1a2142016-06-28 14:49:26 -0700121OBJECTS = $(NOHYPHEN3:.c=.obj)
122PREPROCESSED = $(NOHYPHEN3:.c=.int)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700123
124# Borland's command line compiler (BCC32) version 5.5.1 integrated
125# preprocessor has a bug which results in silently generating wrong
126# definitions for libcurl macros such as CURL_OFF_T_C, on the other
127# hand Borland's command line preprocessor (CPP32) version 5.5.1 does
128# not have the bug and achieves proper results. In order to avoid the
129# silent bug we first preprocess source files and later compile the
130# preprocessed result.
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700131
132.c.obj:
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700133 @-$(RM) $(@R).int
134 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
135 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700136
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700137all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
138
139asyn_ares.obj: asyn-ares.c
140 @-$(RM) $(@R).int
141 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
142 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
143
144asyn_thread.obj: asyn-thread.c
145 @-$(RM) $(@R).int
146 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
147 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
148
149non_ascii.obj: non-ascii.c
150 @-$(RM) $(@R).int
151 $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
152 $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700153
154clean:
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700155 cd $(OBJDIR)
156 @-$(RM) $(OBJECTS)
157 @-$(RM) $(PREPROCESSED)
158 cd ..
159 @-$(RMDIR) $(OBJDIR)
160 @-$(RM) $(LIBCURL_LIB)
161 @-$(RM) $(LIBCURL_IMPLIB)
162 @-$(RM) libcurl.tds
163
164$(OBJDIR):
165 @-$(RMDIR) $(OBJDIR)
166 @-$(MKDIR) $(OBJDIR)
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700167
168$(LIBCURL_LIB): $(OBJECTS)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700169 @-$(RM) $(LIBCURL_LIB)
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700170 $(LIB) $(LIBFLAGS) $@ @&&!
171+$(**: = &^
172+)
173!
174
175$(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
176 @-$(RM) $(LIBCURL_DLL)
177 @-$(RM) $(LIBCURL_IMPLIB)
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700178 $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
179$(**: = ^
180)
181!
Lucas Eckels9bd90e62012-08-06 15:07:02 -0700182 $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
183
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -0700184
185# End of Makefile.b32