• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#***************************************************************************
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
24############################################################
25#
26#  Makefile.b32 - Borland's C++ Compiler 5.X
27#
28#  'BCCDIR' has to be set up to point to the base directory
29#  of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
30#
31############################################################
32
33!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
43# Edit the path below to point to the base of your Zlib sources.
44!ifndef ZLIB_PATH
45ZLIB_PATH = ..\..\zlib-1.2.8
46!endif
47
48# Edit the path below to point to the base of your OpenSSL package.
49!ifndef OPENSSL_PATH
50OPENSSL_PATH = ..\..\openssl-1.0.2a
51!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
59PP_CMD   = cpp32 -q -P-
60CC_CMD   = bcc32 -q -c
61LD       = bcc32
62RM       = del 2>NUL
63MKDIR    = md
64RMDIR    = rd /q
65LIB      = tlib
66IMPLIB   = implib
67
68CC_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
69LIBFLAGS = /C /P32
70LDFLAGS  = -q -lq -laa -tWD
71
72SRCDIR   = .;.\vauth;.\vtls
73OBJDIR   = .\BCC_objs
74INCDIRS  = -I.;.\lib;..\include
75LINKLIB  = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
76DEFINES  = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
77
78# By default SSPI support is enabled for BCC
79!ifndef DISABLE_SSPI
80DEFINES  = $(DEFINES) -DUSE_WINDOWS_SSPI
81!endif
82
83# 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
89!ifdef WITH_ZLIB
90DEFINES  = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
91INCDIRS  = $(INCDIRS);$(ZLIB_PATH)
92LINKLIB  = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
93!endif
94
95# SSL support is enabled setting WITH_SSL=1
96!ifdef WITH_SSL
97DEFINES  = $(DEFINES) -DUSE_OPENSSL
98INCDIRS  = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
99LINKLIB  = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
100!endif
101
102.autodepend
103
104.path.c   = $(SRCDIR)
105.path.obj = $(OBJDIR)
106.path.int = $(OBJDIR)
107
108# Makefile.inc provides the CSOURCES and HHEADERS defines
109!include Makefile.inc
110
111# Borland's command line librarian program TLIB version 4.5 is not capable
112# of building a library when any of its objects contains an hyphen in its
113# 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:-=_)
118NOHYPHEN2 = $(NOHYPHEN1:vauth/=)
119NOHYPHEN3 = $(NOHYPHEN2:vtls/=)
120
121OBJECTS = $(NOHYPHEN3:.c=.obj)
122PREPROCESSED = $(NOHYPHEN3:.c=.int)
123
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.
131
132.c.obj:
133	@-$(RM) $(@R).int
134	$(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
135	$(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
136
137all:	$(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
153
154clean:
155	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)
167
168$(LIBCURL_LIB): $(OBJECTS)
169	@-$(RM) $(LIBCURL_LIB)
170	$(LIB) $(LIBFLAGS) $@ @&&!
171+$(**: = &^
172+)
173!
174
175$(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
176	@-$(RM) $(LIBCURL_DLL)
177	@-$(RM) $(LIBCURL_IMPLIB)
178	$(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
179$(**: = ^
180)
181!
182	$(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
183
184
185# End of Makefile.b32
186