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 program's name
54PROGNAME = curl.exe
55
56# Setup environment
57PP_CMD   = cpp32 -q -P-
58CC_CMD   = bcc32 -q -c
59LD       = bcc32
60RM       = del 2>NUL
61MKDIR    = md
62RMDIR    = rd /q 2>NUL
63COPY     = $(COMSPEC) /c copy /y
64
65CC_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
66LDFLAGS  = -q -lq -lap
67
68SRCDIRS  = .;..\lib
69OBJDIR   = .\BCC_objs
70INCDIRS  = -I.;..\include;..\lib
71LINKLIB  = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
72DEFINES  = -DNDEBUG -DWIN32
73
74!ifdef DYNAMIC
75LIBCURL_LIB = ..\lib\libcurl_imp.lib
76!else
77LIBCURL_LIB = ..\lib\libcurl.lib
78DEFINES = $(DEFINES) -DCURL_STATICLIB
79!endif
80
81# ZLIB support is enabled setting WITH_ZLIB=1
82!ifdef WITH_ZLIB
83DEFINES  = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
84INCDIRS  = $(INCDIRS);$(ZLIB_PATH)
85LINKLIB  = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
86!endif
87
88# SSL support is enabled setting WITH_SSL=1
89!ifdef WITH_SSL
90DEFINES  = $(DEFINES) -DUSE_OPENSSL
91INCDIRS  = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
92LINKLIB  = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
93!endif
94
95.autodepend
96
97.path.c   = $(SRCDIRS)
98.path.obj = $(OBJDIR)
99.path.int = $(OBJDIR)
100
101# Makefile.inc provides the CSOURCES and HHEADERS defines
102!include Makefile.inc
103
104CSOURCES = $(CURL_CFILES) $(CURLX_CFILES:../lib/=)
105OBJECTS  = $(CSOURCES:.c=.obj)
106PREPROCESSED = $(CSOURCES:.c=.int)
107
108# Borland's command line compiler (BCC32) version 5.5.1 integrated
109# preprocessor has a bug which results in silently generating wrong
110# definitions for libcurl macros such as CURL_OFF_T_C, on the other
111# hand Borland's command line preprocessor (CPP32) version 5.5.1 does
112# not have the bug and achieves proper results. In order to avoid the
113# silent bug we first preprocess source files and later compile the
114# preprocessed result.
115
116.c.obj:
117	@-$(RM) $(@R).int
118	$(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
119	$(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
120
121all:	$(OBJDIR) tool_hugehelp $(PROGNAME)
122
123clean:
124	cd $(OBJDIR)
125	@-$(RM) $(OBJECTS)
126	@-$(RM) $(PREPROCESSED)
127	cd ..
128	@-$(RMDIR) $(OBJDIR)
129	@-$(RM) $(PROGNAME)
130	@-$(RM) curl.tds
131
132$(OBJDIR):
133	@-$(RMDIR) $(OBJDIR)
134	@-$(MKDIR) $(OBJDIR)
135
136!ifdef WITH_ZLIB
137tool_hugehelp: ..\docs\MANUAL ..\docs\curl.1 mkhelp.pl
138        groff -Tascii -man -P -c ../docs/curl.1 > tool_hugehelp.tmp
139        perl -w mkhelp.pl -c ../docs/MANUAL < tool_hugehelp.tmp > tool_hugehelp.c
140	@-$(RM) tool_hugehelp.tmp
141!else
142tool_hugehelp:
143	if exist ..\GIT-INFO $(COPY) tool_hugehelp.c.cvs tool_hugehelp.c
144!endif
145
146$(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB)
147	@-$(RM) $(PROGNAME)
148	$(LD) $(LDFLAGS) -e$@ @&&!
149$(**: = ^
150)
151!
152
153
154# End of Makefile.b32
155