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