Imported Upstream version 7.48.0
[platform/upstream/curl.git] / lib / Makefile.b32
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
40 BCCDIR = $(MAKEDIR)\..
41 !endif
42
43 # Edit the path below to point to the base of your Zlib sources.
44 !ifndef ZLIB_PATH
45 ZLIB_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
50 OPENSSL_PATH = ..\..\openssl-1.0.2a
51 !endif
52
53 # Set libcurl static lib, dll and import lib
54 LIBCURL_LIB    = libcurl.lib
55 LIBCURL_DLL    = libcurl.dll
56 LIBCURL_IMPLIB = libcurl_imp.lib
57
58 # Setup environment
59 PP_CMD   = cpp32 -q -P-
60 CC_CMD   = bcc32 -q -c
61 LD       = bcc32
62 RM       = del 2>NUL
63 MKDIR    = md
64 RMDIR    = rd /q
65 LIB      = tlib
66 IMPLIB   = implib
67
68 CC_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
69 LIBFLAGS = /C /P32
70 LDFLAGS  = -q -lq -laa -tWD
71
72 SRCDIR   = .;.\vtls
73 OBJDIR   = .\BCC_objs
74 INCDIRS  = -I.;.\lib;..\include
75 LINKLIB  = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
76 DEFINES  = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
77
78 # By default SSPI support is enabled for BCC
79 !ifndef DISABLE_SSPI
80 DEFINES  = $(DEFINES) -DUSE_WINDOWS_SSPI
81 !endif
82
83 # By default LDAP support is disabled for BCC
84 !ifndef WITH_LDAP
85 DEFINES  = $(DEFINES) -DCURL_DISABLE_LDAP
86 !endif
87
88 # ZLIB support is enabled setting WITH_ZLIB=1
89 !ifdef WITH_ZLIB
90 DEFINES  = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
91 INCDIRS  = $(INCDIRS);$(ZLIB_PATH)
92 LINKLIB  = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
93 !endif
94
95 # SSL support is enabled setting WITH_SSL=1
96 !ifdef WITH_SSL
97 DEFINES  = $(DEFINES) -DUSE_OPENSSL
98 INCDIRS  = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
99 LINKLIB  = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
100 !endif
101
102 .autodepend
103
104 .path.c   = $(SRCDIR)
105 .path.obj = $(OBJDIR)
106 .path.int = $(OBJDIR)
107
108 # Makefile.inc provides the CSOURCES and HHEADERS defines
109 !include Makefile.inc
110
111 # Borland's command line librarian program TLIB version 4.5 is not capable
112 # of building a library when any of its objects contains an hypen in its
113 # name, due to a command line parsing bug. In order to workaround this, we
114 # build source files with hyphens in their name as objects with underscores
115 # using explicit compilation build rules instead of implicit ones.
116
117 NOHYPHEN1 = $(CSOURCES:-=_)
118 NOHYPHEN2 = $(NOHYPHEN1:vtls/=)
119
120 OBJECTS = $(NOHYPHEN2:.c=.obj)
121 PREPROCESSED = $(NOHYPHEN2:.c=.int)
122
123 # Borland's command line compiler (BCC32) version 5.5.1 integrated
124 # preprocessor has a bug which results in silently generating wrong
125 # definitions for libcurl macros such as CURL_OFF_T_C, on the other
126 # hand Borland's command line preprocessor (CPP32) version 5.5.1 does
127 # not have the bug and achieves proper results. In order to avoid the
128 # silent bug we first preprocess source files and later compile the
129 # preprocessed result.
130
131 .c.obj:
132         @-$(RM) $(@R).int
133         $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
134         $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
135
136 all:    $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
137
138 asyn_ares.obj: asyn-ares.c
139         @-$(RM) $(@R).int
140         $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
141         $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
142
143 asyn_thread.obj: asyn-thread.c
144         @-$(RM) $(@R).int
145         $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
146         $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
147
148 non_ascii.obj: non-ascii.c
149         @-$(RM) $(@R).int
150         $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
151         $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
152
153 clean:
154         cd $(OBJDIR)
155         @-$(RM) $(OBJECTS)
156         @-$(RM) $(PREPROCESSED)
157         cd ..
158         @-$(RMDIR) $(OBJDIR)
159         @-$(RM) $(LIBCURL_LIB)
160         @-$(RM) $(LIBCURL_IMPLIB)
161         @-$(RM) libcurl.tds
162
163 $(OBJDIR):
164         @-$(RMDIR) $(OBJDIR)
165         @-$(MKDIR) $(OBJDIR)
166
167 $(LIBCURL_LIB): $(OBJECTS)
168         @-$(RM) $(LIBCURL_LIB)
169         $(LIB) $(LIBFLAGS) $@ @&&!
170 +$(**: = &^
171 +)
172 !
173
174 $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
175         @-$(RM) $(LIBCURL_DLL)
176         @-$(RM) $(LIBCURL_IMPLIB)
177         $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
178 $(**: = ^
179 )
180 !
181         $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
182
183
184 # End of Makefile.b32