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@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
20BCCDIR = $(MAKEDIR)\..
21!endif
22
23# Edit the path below to point to the base of your Zlib sources.
24!ifndef ZLIB_PATH
25ZLIB_PATH = ..\..\zlib-1.2.5
26!endif
27
28# Edit the path below to point to the base of your OpenSSL package.
29!ifndef OPENSSL_PATH
30OPENSSL_PATH = ..\..\openssl-0.9.8q
31!endif
32
33# Set program's name
34PROGNAME = curl.exe
35
36# Setup environment
37CC_CMD   = bcc32 -q -c
38LD       = bcc32
39RM       = del 2>NUL
40MKDIR    = md
41RMDIR    = rd /q 2>nul
42COPY     = $(COMSPEC) /c copy /y
43
44CC_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
45LDFLAGS  = -q -lq -lap
46
47SRCDIRS  = .;..\lib
48OBJDIR   = .\BCC_objs
49INCDIRS  = -I.;..\include;..\lib
50LINKLIB  = $(BCCDIR)\lib\cw32mt.lib
51DEFINES  = -DNDEBUG -DWIN32
52
53!ifdef DYNAMIC
54LIBCURL_LIB = ..\lib\libcurl_imp.lib
55!else
56LIBCURL_LIB = ..\lib\libcurl.lib
57DEFINES = $(DEFINES) -DCURL_STATICLIB
58!endif
59
60# ZLIB support is enabled setting WITH_ZLIB=1
61!ifdef WITH_ZLIB
62DEFINES  = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
63INCDIRS  = $(INCDIRS);$(ZLIB_PATH)
64LINKLIB  = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
65!endif
66
67# SSL support is enabled setting WITH_SSL=1
68!ifdef WITH_SSL
69DEFINES  = $(DEFINES) -DUSE_SSLEAY
70INCDIRS  = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
71LINKLIB  = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
72!endif
73
74.autodepend
75
76.path.c   = $(SRCDIRS)
77.path.obj = $(OBJDIR)
78
79# Makefile.inc provides the CSOURCES and HHEADERS defines
80!undef top_srcdir
81!include Makefile.inc
82
83CSOURCES = $(CURL_CFILES) $(CURLX_ONES:/lib/=)
84OBJECTS  = $(CSOURCES:.c=.obj)
85
86.c.obj:
87	$(CC_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$@ $<
88
89all:	$(OBJDIR) hugehelp $(PROGNAME)
90
91clean:
92	cd $(OBJDIR)
93	@-$(RM) $(OBJECTS)
94	cd ..
95	@-$(RMDIR) $(OBJDIR)
96	@-$(RM) $(PROGNAME)
97	@-$(RM) curl.tds
98
99$(OBJDIR):
100	@-$(RMDIR) $(OBJDIR)
101	@-$(MKDIR) $(OBJDIR)
102
103!ifdef WITH_ZLIB
104hugehelp: ..\docs\MANUAL ..\docs\curl.1 mkhelp.pl
105        groff -Tascii -man -P -c ../docs/curl.1 > hugehelp.tmp
106        perl -w mkhelp.pl -c ../docs/MANUAL < hugehelp.tmp > hugehelp.c
107	@-$(RM) hugehelp.tmp
108!else
109hugehelp:
110	$(COPY) hugehelp.c.cvs hugehelp.c
111!endif
112
113$(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB)
114	@-$(RM) $(PROGNAME)
115	$(LD) $(LDFLAGS) -e$@ $**
116
117
118# End of Makefile.b32
119