Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 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 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 24 | ############################################################ |
| 25 | # |
| 26 | # Makefile.b32 - Borland's C++ Compiler 5.X |
| 27 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 28 | # 'BCCDIR' has to be set up to point to the base directory |
| 29 | # of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 30 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 31 | ############################################################ |
| 32 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 43 | # Edit the path below to point to the base of your Zlib sources. |
| 44 | !ifndef ZLIB_PATH |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 45 | ZLIB_PATH = ..\..\zlib-1.2.8 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 46 | !endif |
| 47 | |
| 48 | # Edit the path below to point to the base of your OpenSSL package. |
| 49 | !ifndef OPENSSL_PATH |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 50 | OPENSSL_PATH = ..\..\openssl-1.0.2a |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 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 |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 59 | PP_CMD = cpp32 -q -P- |
| 60 | CC_CMD = bcc32 -q -c |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 61 | LD = bcc32 |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 62 | RM = del 2>NUL |
| 63 | MKDIR = md |
| 64 | RMDIR = rd /q |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 65 | LIB = tlib |
| 66 | IMPLIB = implib |
| 67 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 69 | LIBFLAGS = /C /P32 |
| 70 | LDFLAGS = -q -lq -laa -tWD |
| 71 | |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 72 | SRCDIR = .;.\vauth;.\vtls |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 77 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 78 | # By default SSPI support is enabled for BCC |
| 79 | !ifndef DISABLE_SSPI |
| 80 | DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI |
| 81 | !endif |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 82 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 89 | !ifdef WITH_ZLIB |
| 90 | DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H |
| 91 | INCDIRS = $(INCDIRS);$(ZLIB_PATH) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 92 | LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 93 | !endif |
| 94 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 95 | # SSL support is enabled setting WITH_SSL=1 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 96 | !ifdef WITH_SSL |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 100 | !endif |
| 101 | |
| 102 | .autodepend |
| 103 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 104 | .path.c = $(SRCDIR) |
| 105 | .path.obj = $(OBJDIR) |
| 106 | .path.int = $(OBJDIR) |
| 107 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 108 | # Makefile.inc provides the CSOURCES and HHEADERS defines |
| 109 | !include Makefile.inc |
| 110 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 111 | # Borland's command line librarian program TLIB version 4.5 is not capable |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 112 | # of building a library when any of its objects contains an hyphen in its |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 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:-=_) |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 118 | NOHYPHEN2 = $(NOHYPHEN1:vauth/=) |
| 119 | NOHYPHEN3 = $(NOHYPHEN2:vtls/=) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 120 | |
Alex Deymo | 8f1a214 | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 121 | OBJECTS = $(NOHYPHEN3:.c=.obj) |
| 122 | PREPROCESSED = $(NOHYPHEN3:.c=.int) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 123 | |
| 124 | # Borland's command line compiler (BCC32) version 5.5.1 integrated |
| 125 | # preprocessor has a bug which results in silently generating wrong |
| 126 | # definitions for libcurl macros such as CURL_OFF_T_C, on the other |
| 127 | # hand Borland's command line preprocessor (CPP32) version 5.5.1 does |
| 128 | # not have the bug and achieves proper results. In order to avoid the |
| 129 | # silent bug we first preprocess source files and later compile the |
| 130 | # preprocessed result. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 131 | |
| 132 | .c.obj: |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 133 | @-$(RM) $(@R).int |
| 134 | $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<) |
| 135 | $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 136 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 137 | all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL) |
| 138 | |
| 139 | asyn_ares.obj: asyn-ares.c |
| 140 | @-$(RM) $(@R).int |
| 141 | $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) |
| 142 | $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int |
| 143 | |
| 144 | asyn_thread.obj: asyn-thread.c |
| 145 | @-$(RM) $(@R).int |
| 146 | $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) |
| 147 | $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int |
| 148 | |
| 149 | non_ascii.obj: non-ascii.c |
| 150 | @-$(RM) $(@R).int |
| 151 | $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?) |
| 152 | $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 153 | |
| 154 | clean: |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 155 | cd $(OBJDIR) |
| 156 | @-$(RM) $(OBJECTS) |
| 157 | @-$(RM) $(PREPROCESSED) |
| 158 | cd .. |
| 159 | @-$(RMDIR) $(OBJDIR) |
| 160 | @-$(RM) $(LIBCURL_LIB) |
| 161 | @-$(RM) $(LIBCURL_IMPLIB) |
| 162 | @-$(RM) libcurl.tds |
| 163 | |
| 164 | $(OBJDIR): |
| 165 | @-$(RMDIR) $(OBJDIR) |
| 166 | @-$(MKDIR) $(OBJDIR) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 167 | |
| 168 | $(LIBCURL_LIB): $(OBJECTS) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 169 | @-$(RM) $(LIBCURL_LIB) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 170 | $(LIB) $(LIBFLAGS) $@ @&&! |
| 171 | +$(**: = &^ |
| 172 | +) |
| 173 | ! |
| 174 | |
| 175 | $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB) |
| 176 | @-$(RM) $(LIBCURL_DLL) |
| 177 | @-$(RM) $(LIBCURL_IMPLIB) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 178 | $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&! |
| 179 | $(**: = ^ |
| 180 | ) |
| 181 | ! |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 182 | $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL) |
| 183 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 184 | |
| 185 | # End of Makefile.b32 |