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.7
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.8y
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!include Makefile.inc
81
82CSOURCES = $(CURL_CFILES) $(CURLX_ONES:../lib/=)
83OBJECTS  = $(CSOURCES:.c=.obj)
84
85.c.obj:
86	$(CC_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$@ $<
87
88all:	$(OBJDIR) tool_hugehelp $(PROGNAME)
89
90clean:
91	cd $(OBJDIR)
92	@-$(RM) $(OBJECTS)
93	cd ..
94	@-$(RMDIR) $(OBJDIR)
95	@-$(RM) $(PROGNAME)
96	@-$(RM) curl.tds
97
98$(OBJDIR):
99	@-$(RMDIR) $(OBJDIR)
100	@-$(MKDIR) $(OBJDIR)
101
102!ifdef WITH_ZLIB
103tool_hugehelp: ..\docs\MANUAL ..\docs\curl.1 mkhelp.pl
104        groff -Tascii -man -P -c ../docs/curl.1 > tool_hugehelp.tmp
105        perl -w mkhelp.pl -c ../docs/MANUAL < tool_hugehelp.tmp > tool_hugehelp.c
106	@-$(RM) tool_hugehelp.tmp
107!else
108tool_hugehelp:
109	$(COPY) tool_hugehelp.c.cvs tool_hugehelp.c
110!endif
111
112$(PROGNAME): $(OBJECTS) $(LIBCURL_LIB) $(LINKLIB)
113	@-$(RM) $(PROGNAME)
114	$(LD) $(LDFLAGS) -e$@ $**
115
116
117# End of Makefile.b32
118