extensions/curl/curl-src/src/Makefile.Watcom
changeset 3839 05c359144594
parent 2518 5d227a11b850
child 3842 04ca50d3cb60
     1.1 --- a/extensions/curl/curl-src/src/Makefile.Watcom	Sun Mar 17 22:05:33 2013 +0000
     1.2 +++ b/extensions/curl/curl-src/src/Makefile.Watcom	Sun Mar 17 22:23:20 2013 +0000
     1.3 @@ -2,107 +2,211 @@
     1.4  #  Watcom / OpenWatcom / Win32 makefile for cURL.
     1.5  #  G. Vanem <[email protected]>
     1.6  #
     1.7 -# $Id: Makefile.Watcom,v 1.13 2008-10-27 15:47:59 giva Exp $
     1.8 +
     1.9 +!ifndef %watcom
    1.10 +!error WATCOM environment variable not set!
    1.11 +!endif
    1.12 +
    1.13 +!ifdef %libname
    1.14 +LIBNAME = $(%libname)
    1.15 +!else
    1.16 +LIBNAME = libcurl
    1.17 +!endif
    1.18 +TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib
    1.19  
    1.20  CC = wcc386
    1.21 +LD = wlink
    1.22 +AR = wlib
    1.23 +RC = wrc
    1.24  
    1.25 -CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm &
    1.26 -         -bt=nt -d+ -dWIN32 -dHAVE_STRTOLL -dCURLDEBUG -dENABLE_IPV6    &
    1.27 -         -dHAVE_WINSOCK2_H -I..\include -I..\lib
    1.28 +!ifdef __LOADDLL__
    1.29 +!  loaddll wcc386  wccd386
    1.30 +!  loaddll wpp386  wppd386
    1.31 +!  loaddll wlib    wlibd
    1.32 +!  if $(__VERSION__) > 1270
    1.33 +!    loaddll wlink   wlinkd
    1.34 +!  else
    1.35 +!    loaddll wlink   wlink
    1.36 +!  endif
    1.37 +!endif
    1.38  
    1.39 -OBJ_DIR = WC_Win32.obj
    1.40 +!ifdef __LINUX__
    1.41 +DS = /
    1.42 +CP = cp
    1.43 +MD = mkdir -p
    1.44 +RD = rmdir -p
    1.45 +RM = rm -f
    1.46 +!else
    1.47 +DS = $(X)\$(X)
    1.48 +CP = copy 2>NUL
    1.49 +MD = mkdir
    1.50 +RD = rmdir /q /s 2>NUL
    1.51 +!if $(__VERSION__) < 1250
    1.52 +RM = del /q /f 2>NUL
    1.53 +!else
    1.54 +RM = rm -f
    1.55 +!endif
    1.56 +!endif
    1.57 +
    1.58 +SYS_INCL = -I$(%watcom)$(DS)h$(DS)nt -I$(%watcom)$(DS)h
    1.59 +SYS_LIBS = $(%watcom)$(DS)lib386$(DS)nt;$(%watcom)$(DS)lib386
    1.60 +
    1.61 +CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm &
    1.62 +         -wcd=201 -bt=nt -bc -d+ -dWIN32 -dHAVE_STRTOLL             &
    1.63 +         -I..$(DS)include -I..$(DS)lib $(SYS_INCL)
    1.64 +
    1.65 +!ifdef %debug
    1.66 +DEBUG  = -dDEBUG=1 -dDEBUGBUILD
    1.67 +CFLAGS += -d3 $(DEBUG)
    1.68 +!else
    1.69 +CFLAGS += -d0
    1.70 +!endif
    1.71 +
    1.72 +!ifdef %use_ipv6
    1.73 +CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
    1.74 +!endif
    1.75  
    1.76 -OBJS = $(OBJ_DIR)\getpass.obj  $(OBJ_DIR)\homedir.obj  $(OBJ_DIR)\hugehelp.obj &
    1.77 -       $(OBJ_DIR)\main.obj     $(OBJ_DIR)\urlglob.obj  $(OBJ_DIR)\writeenv.obj &
    1.78 -       $(OBJ_DIR)\writeout.obj $(OBJ_DIR)\curlutil.obj $(OBJ_DIR)\rawstr.obj
    1.79 +#
    1.80 +# Change to suite.
    1.81 +#
    1.82 +!ifdef %zlib_root
    1.83 +ZLIB_ROOT = $(%zlib_root)
    1.84 +!else
    1.85 +ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.7
    1.86 +!endif
    1.87 +
    1.88 +!ifdef %libssh2_root
    1.89 +LIBSSH2_ROOT = $(%libssh2_root)
    1.90 +!else
    1.91 +LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.3
    1.92 +!endif
    1.93 +
    1.94 +!ifdef %librtmp_root
    1.95 +LIBRTMP_ROOT = $(%librtmp_root)
    1.96 +!else
    1.97 +LIBRTMP_ROOT = ..$(DS)..$(DS)rtmpdump-2.3
    1.98 +!endif
    1.99 +
   1.100 +!ifdef %openssl_root
   1.101 +OPENSSL_ROOT = $(%openssl_root)
   1.102 +!else
   1.103 +OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8x
   1.104 +!endif
   1.105 +
   1.106 +!ifdef %ares_root
   1.107 +ARES_ROOT = $(%ares_root)
   1.108 +!else
   1.109 +ARES_ROOT = ..$(DS)ares
   1.110 +!endif
   1.111  
   1.112 -RESOURCE = $(OBJ_DIR)\curl.res
   1.113 +!ifdef %use_ssl
   1.114 +CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I$(OPENSSL_ROOT)$(DS)inc32
   1.115 +!endif
   1.116 +
   1.117 +OBJ_DIR  = WC_Win32.obj
   1.118 +LINK_ARG = $(OBJ_DIR)$(DS)wlink.arg
   1.119 +
   1.120 +# In order to process Makefile.inc wmake must be called with -u switch!
   1.121 +!ifndef %MAKEFLAGS
   1.122 +!error You MUST call wmake with the -u switch!
   1.123 +!else
   1.124 +!include Makefile.inc
   1.125 +!endif
   1.126 +# For now we still define the CURLX_ONES sources here unless we know how
   1.127 +# to split off the prefixed path.
   1.128 +CURLX_SOURCES = rawstr.c nonblock.c
   1.129  
   1.130 -all: hugehelp.c $(OBJ_DIR) curl.exe .SYMBOLIC
   1.131 +OBJS = $(CURL_CFILES:.c=.obj)
   1.132 +!ifdef %curl_static
   1.133 +CFLAGS += -DCURL_STATICLIB
   1.134 +!else
   1.135 +CFLAGS += -br
   1.136 +OBJS += $(CURLX_SOURCES:.c=.obj)
   1.137 +!endif
   1.138 +!ifdef __LINUX__
   1.139 +OBJS = $OBJ_DIR/$(OBJS: = $OBJ_DIR/)
   1.140 +
   1.141 +!else
   1.142 +OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
   1.143 +!endif
   1.144 +
   1.145 +RESOURCE = $(OBJ_DIR)$(DS)curl.res
   1.146 +
   1.147 +all: tool_hugehelp.c $(OBJ_DIR) curl.exe .SYMBOLIC
   1.148  	@echo Welcome to cURL
   1.149  
   1.150 -hugehelp.c: hugehelp.c.cvs
   1.151 -	copy hugehelp.c.cvs hugehelp.c
   1.152 +clean: .SYMBOLIC
   1.153 +	-$(RM) $(OBJS)
   1.154 +	-$(RM) $(RESOURCE) $(LINK_ARG)
   1.155 +
   1.156 +vclean distclean: clean .SYMBOLIC
   1.157 +	-$(RD) $(OBJ_DIR)
   1.158 +	-$(RM) curl.exe curl.map curl.sym tool_hugehelp.c
   1.159 +
   1.160 +tool_hugehelp.c: tool_hugehelp.c.cvs
   1.161 +	$(CP) $[@ $^@
   1.162 +
   1.163 +tool_hugehelp.c.cvs: .EXISTSONLY
   1.164 +	$(CP) tool_hugehelp.c $^@
   1.165  
   1.166  $(OBJ_DIR):
   1.167 -	mkdir $(OBJ_DIR)
   1.168 +	-$(MD) $^@
   1.169  
   1.170 -curl.exe: $(OBJS) $(RESOURCE)
   1.171 -	wlink name $@ system nt file { $(OBJS) }                   &
   1.172 -	  option quiet, map, caseexact, eliminate, res=$(RESOURCE) &
   1.173 -	  libpath $(%watcom)\lib386;$(%watcom)\lib386\nt           &
   1.174 -	  library ..\lib\libcurl_wc_imp.lib, clib3r.lib, ws2_32.lib
   1.175 -
   1.176 -clean: .SYMBOLIC
   1.177 -	- rm -f $(OBJS) $(RESOURCE)
   1.178 -
   1.179 -vclean realclean: clean .SYMBOLIC
   1.180 - 	- rm -f curl.exe curl.map hugehelp.c
   1.181 -	- rmdir $(OBJ_DIR)
   1.182 +curl.exe: $(OBJS) $(RESOURCE) $(LINK_ARG)
   1.183 +	$(LD) name $^@ @$]@
   1.184  
   1.185  $(RESOURCE): curl.rc
   1.186 -	wrc -dCURLDEBUG=1 -q -r -zm -I..\include -fo=$@ curl.rc
   1.187 +	$(RC) $(DEBUG) -q -r -zm -bt=nt -I..$(DS)include $(SYS_INCL) $[@ -fo=$^@
   1.188 +
   1.189 +# suffix search path - vpath-like hack
   1.190 +.c: ..$(DS)lib
   1.191  
   1.192  .ERASE
   1.193  .c{$(OBJ_DIR)}.obj:
   1.194 -	$(CC) $[@ $(CFLAGS) -fo=$@
   1.195 -
   1.196 -.ERASE
   1.197 -$(OBJ_DIR)\rawstr.obj: ..\lib\rawstr.c
   1.198 -	$(CC) $[@ $(CFLAGS) -fo=$@
   1.199 -
   1.200 -#
   1.201 -# Dependencies based on "gcc -MM .."
   1.202 -#
   1.203 -$(OBJ_DIR)\getpass.obj: getpass.c setup.h config-win32.h ..\lib\setup_once.h getpass.h &
   1.204 -  ..\lib\memdebug.h ..\lib\setup.h ..\lib\config-win32.h &
   1.205 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h &
   1.206 -  ..\include\curl\curl.h ..\include\curl\curlver.h &
   1.207 -  ..\include\curl\curlrules.h ..\include\curl\easy.h &
   1.208 -  ..\include\curl\multi.h ..\include\curl\curl.h
   1.209 -
   1.210 -$(OBJ_DIR)\homedir.obj: homedir.c setup.h config-win32.h ..\lib\setup_once.h homedir.h &
   1.211 -  ..\lib\memdebug.h ..\lib\setup.h ..\lib\config-win32.h &
   1.212 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h &
   1.213 -  ..\include\curl\curl.h ..\include\curl\curlver.h &
   1.214 -  ..\include\curl\curlrules.h ..\include\curl\easy.h &
   1.215 -  ..\include\curl\multi.h ..\include\curl\curl.h
   1.216 -
   1.217 -$(OBJ_DIR)\hugehelp.obj: hugehelp.c
   1.218 +	$(CC) $(CFLAGS) $[@ -fo=$^@
   1.219  
   1.220 -$(OBJ_DIR)\main.obj: main.c setup.h config-win32.h ..\lib\setup_once.h &
   1.221 -  ..\include\curl\curl.h ..\include\curl\curlver.h &
   1.222 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h &
   1.223 -  ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
   1.224 -  urlglob.h writeout.h getpass.h homedir.h curlutil.h hugehelp.h &
   1.225 -  version.h ..\include\curl\curlver.h ..\lib\curlx.h &
   1.226 -  ..\include\curl\mprintf.h ..\lib\strequal.h ..\lib\strtoofft.h &
   1.227 -  ..\lib\setup.h ..\lib\config-win32.h ..\include\curl\curlbuild.h &
   1.228 -  ..\include\curl\curlrules.h ..\lib\timeval.h ..\lib\memdebug.h
   1.229 -
   1.230 -$(OBJ_DIR)\urlglob.obj: urlglob.c setup.h config-win32.h ..\lib\setup_once.h &
   1.231 -  ..\include\curl\curl.h ..\include\curl\curlver.h &
   1.232 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h &
   1.233 -  ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
   1.234 -  ..\include\curl\mprintf.h urlglob.h ..\lib\memdebug.h ..\lib\setup.h &
   1.235 -  ..\lib\config-win32.h ..\include\curl\curlbuild.h &
   1.236 -  ..\include\curl\curlrules.h
   1.237 +$(LINK_ARG): $(__MAKEFILES__)
   1.238 +	%create $^@
   1.239 +	@%append $^@ system nt
   1.240 +	@%append $^@ file { $(OBJS) }
   1.241 +!ifdef %debug
   1.242 +	@%append $^@ debug all
   1.243 +	@%append $^@ option symfile
   1.244 +!endif
   1.245 +	@%append $^@ option quiet, map, caseexact, eliminate,
   1.246 +	@%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
   1.247 +!ifdef %curl_static
   1.248 +	@%append $^@ library wldap32.lib
   1.249 +	@%append $^@ library ..$(DS)lib$(DS)$(LIBNAME).lib
   1.250 +!ifdef %use_zlib
   1.251 +	@%append $^@ library $(ZLIB_ROOT)$(DS)zlib.lib
   1.252 +!endif
   1.253 +!ifdef %use_rtmp
   1.254 +	@%append $^@ library $(LIBRTMP_ROOT)$(DS)librtmp$(DS)librtmp.lib, winmm.lib
   1.255 +!endif
   1.256 +!ifdef %use_ssh2
   1.257 +	@%append $^@ library $(LIBSSH2_ROOT)$(DS)win32$(DS)libssh2.lib
   1.258 +!endif
   1.259 +!ifdef %use_ssl
   1.260 +	@%append $^@ library $(OPENSSL_ROOT)$(DS)out32$(DS)libeay32.lib, $(OPENSSL_ROOT)$(DS)out32$(DS)ssleay32.lib
   1.261 +!endif
   1.262 +!ifdef %use_ares
   1.263 +	@%append $^@ library $(ARES_ROOT)$(DS)cares.lib
   1.264 +!endif
   1.265 +!ifdef %use_winidn
   1.266 +!  if $(__VERSION__) > 1290
   1.267 +	@%append $^@ library normaliz.lib
   1.268 +!  else
   1.269 +	@%append $^@ import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
   1.270 +	@%append $^@ import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
   1.271 +!  endif
   1.272 +!endif
   1.273 +!else
   1.274 +	@%append $^@ library ..$(DS)lib$(DS)$(LIBNAME)_imp.lib
   1.275 +!endif
   1.276 +!ifeq USE_WATT32 1
   1.277 +	@%append $^@ library $(%watt_root)$(DS)lib$(DS)wattcpw_imp.lib
   1.278 +!else
   1.279 +	@%append $^@ library ws2_32.lib
   1.280 +!endif
   1.281  
   1.282 -$(OBJ_DIR)\writeenv.obj: writeenv.c setup.h config-win32.h ..\lib\setup_once.h
   1.283 -
   1.284 -$(OBJ_DIR)\writeout.obj: writeout.c setup.h config-win32.h ..\lib\setup_once.h &
   1.285 -  ..\include\curl\curl.h ..\include\curl\curlver.h &
   1.286 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h &
   1.287 -  ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
   1.288 -  ..\include\curl\mprintf.h writeout.h
   1.289 -
   1.290 -$(OBJ_DIR)\curlutil.obj: curlutil.c setup.h config-win32.h ..\lib\setup_once.h &
   1.291 -  curlutil.h
   1.292 -
   1.293 -$(OBJ_DIR)\rawstr.obj: ..\lib\rawstr.c ..\lib\setup.h ..\lib\config-win32.h &
   1.294 -  ..\include\curl\curlbuild.h ..\include\curl\curlrules.h ..\lib\setup_once.h &
   1.295 -  ..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\curlrules.h &
   1.296 -  ..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
   1.297 -  ..\lib\strerror.h ..\lib\urldata.h ..\lib\cookie.h ..\lib\formdata.h &
   1.298 -  ..\lib\timeval.h ..\lib\http_chunks.h ..\lib\hostip.h ..\lib\hash.h &
   1.299 -  ..\lib\llist.h ..\lib\splay.h ..\include\curl\mprintf.h