1############################################################
2#
3#  Makefile.b32 - Borland's C++ Compiler 5.X
4#
5#  'lib' 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 libcurl static lib, dll and import lib
34LIBCURL_LIB    = libcurl.lib
35LIBCURL_DLL    = libcurl.dll
36LIBCURL_IMPLIB = libcurl_imp.lib
37
38# Setup environment
39PP_CMD   = cpp32 -q -P-
40CC_CMD   = bcc32 -q -c
41LD       = bcc32
42RM       = del 2>NUL
43MKDIR    = md
44RMDIR    = rd /q
45LIB      = tlib
46IMPLIB   = implib
47
48CC_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
49LIBFLAGS = /C /P32
50LDFLAGS  = -q -lq -laa -tWD
51
52SRCDIR   = .
53OBJDIR   = .\BCC_objs
54INCDIRS  = -I.;..\include
55LINKLIB  = $(BCCDIR)\lib\cw32mt.lib
56DEFINES  = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
57
58# By default SSPI support is enabled for BCC
59!ifndef DISABLE_SSPI
60DEFINES  = $(DEFINES) -DUSE_WINDOWS_SSPI
61!endif
62
63# By default LDAP support is disabled for BCC
64!ifndef WITH_LDAP
65DEFINES  = $(DEFINES) -DCURL_DISABLE_LDAP
66!endif
67
68# ZLIB support is enabled setting WITH_ZLIB=1
69!ifdef WITH_ZLIB
70DEFINES  = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
71INCDIRS  = $(INCDIRS);$(ZLIB_PATH)
72LINKLIB  = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
73!endif
74
75# SSL support is enabled setting WITH_SSL=1
76!ifdef WITH_SSL
77DEFINES  = $(DEFINES) -DUSE_SSLEAY
78INCDIRS  = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
79LINKLIB  = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
80!endif
81
82.autodepend
83
84.path.c   = $(SRCDIR)
85.path.obj = $(OBJDIR)
86.path.int = $(OBJDIR)
87
88# Makefile.inc provides the CSOURCES and HHEADERS defines
89!include Makefile.inc
90
91OBJECTS = $(CSOURCES:.c=.obj)
92PREPROCESSED = $(CSOURCES:.c=.int)
93
94.c.obj:
95	@-$(RM) $(@R).int
96	$(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
97	$(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
98
99all:	$(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
100
101clean:
102	cd $(OBJDIR)
103	@-$(RM) $(OBJECTS)
104	@-$(RM) $(PREPROCESSED)
105	cd ..
106	@-$(RMDIR) $(OBJDIR)
107	@-$(RM) $(LIBCURL_LIB)
108	@-$(RM) $(LIBCURL_IMPLIB)
109	@-$(RM) libcurl.tds
110
111$(OBJDIR):
112	@-$(RMDIR) $(OBJDIR)
113	@-$(MKDIR) $(OBJDIR)
114
115$(LIBCURL_LIB): $(OBJECTS)
116	@-$(RM) $(LIBCURL_LIB)
117	$(LIB) $(LIBFLAGS) $@ @&&!
118+$(**: = &^
119+)
120!
121
122$(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
123	@-$(RM) $(LIBCURL_DLL)
124	@-$(RM) $(LIBCURL_IMPLIB)
125	$(LD) $(LDFLAGS) -e$(LIBCURL_DLL) $**
126	$(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
127
128
129# End of Makefile.b32
130