Makefile.Watcom 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 2005 - 2009, Gisle Vanem <gvanem@yahoo.no>.
  9. # Copyright (C) 2005 - 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. # Watcom / OpenWatcom / Win32 makefile for libcurl.
  25. #
  26. .ERASE
  27. !if $(__VERSION__) < 1280
  28. !message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. !message ! This Open Watcom version is too old and is no longer supported !
  30. !message ! Please download latest version from www.openwatcom.org !
  31. !message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  32. !error Unsupported version of Open Watcom
  33. !endif
  34. !ifndef %watcom
  35. !error WATCOM environment variable not set!
  36. !endif
  37. # In order to process Makefile.inc wmake must be called with -u switch!
  38. !ifndef %MAKEFLAGS
  39. !error You MUST call wmake with the -u switch!
  40. !endif
  41. !ifdef %libname
  42. LIBNAME = $(%libname)
  43. !else
  44. LIBNAME = libcurl
  45. !endif
  46. TARGETS = $(LIBNAME).dll $(LIBNAME).lib
  47. CC = wcc386
  48. LD = wlink
  49. AR = wlib
  50. RC = wrc
  51. !ifdef __LOADDLL__
  52. ! loaddll wcc386 wccd386
  53. ! loaddll wpp386 wppd386
  54. ! loaddll wlib wlibd
  55. ! loaddll wlink wlinkd
  56. !endif
  57. !ifdef __LINUX__
  58. CP = cp
  59. MD = mkdir -p
  60. !else
  61. CP = copy 2>NUL
  62. MD = mkdir
  63. !endif
  64. !if $(__VERSION__) > 1290
  65. RD = rm -rf
  66. !else ifdef __UNIX__
  67. RD = rm -rf
  68. !else
  69. RD = rmdir /q /s 2>NUL
  70. !endif
  71. SYS_INCL = -I"$(%watcom)/h/nt" -I"$(%watcom)/h"
  72. CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
  73. -wcd=201 -bt=nt -d+ -dWIN32 -dCURL_WANTS_CA_BUNDLE_ENV &
  74. -dBUILDING_LIBCURL -I. -I"../include" $(SYS_INCL)
  75. !ifdef %debug
  76. DEBUG = -dDEBUG=1 -dDEBUGBUILD
  77. CFLAGS += -d3 $(DEBUG)
  78. !else
  79. CFLAGS += -d0
  80. !endif
  81. !ifdef %use_ipv6
  82. CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
  83. !endif
  84. !ifdef %use_sspi
  85. CFLAGS += -dUSE_WINDOWS_SSPI
  86. !endif
  87. !ifdef %use_winssl
  88. CFLAGS += -dUSE_WINDOWS_SSPI
  89. CFLAGS += -DUSE_SCHANNEL
  90. !endif
  91. !ifdef %use_winidn
  92. CFLAGS += -dWINVER=0x0600 -dUSE_WIN32_IDN
  93. ! if $(__VERSION__) <= 1290
  94. CFLAGS += -dWANT_IDN_PROTOTYPES
  95. ! endif
  96. !endif
  97. #
  98. # Change to suite.
  99. #
  100. !ifdef %zlib_root
  101. ZLIB_ROOT = $(%zlib_root)
  102. !else
  103. ZLIB_ROOT = ../../zlib-1.2.8
  104. !endif
  105. !ifdef %libssh2_root
  106. LIBSSH2_ROOT = $(%libssh2_root)
  107. !else
  108. LIBSSH2_ROOT = ../../libssh2-1.5.0
  109. !endif
  110. !ifdef %librtmp_root
  111. LIBRTMP_ROOT = $(%librtmp_root)
  112. !else
  113. LIBRTMP_ROOT = ../../rtmpdump-2.3
  114. !endif
  115. !ifdef %openssl_root
  116. OPENSSL_ROOT = $(%openssl_root)
  117. !else
  118. OPENSSL_ROOT = ../../openssl-1.0.2a
  119. !endif
  120. !ifdef %ares_root
  121. ARES_ROOT = $(%ares_root)
  122. !else
  123. ARES_ROOT = ../ares
  124. !endif
  125. !ifdef %use_zlib
  126. CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I"$(ZLIB_ROOT)"
  127. !endif
  128. !ifdef %use_rtmp
  129. CFLAGS += -dUSE_LIBRTMP -I"$(LIBRTMP_ROOT)"
  130. !endif
  131. !ifdef %use_ssh2
  132. CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -I"$(LIBSSH2_ROOT)/include" -I"$(LIBSSH2_ROOT)/win32"
  133. !endif
  134. !ifdef %use_ssl
  135. CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I"$(OPENSSL_ROOT)/inc32"
  136. !endif
  137. !ifdef %use_ares
  138. CFLAGS += -dUSE_ARES -I"$(ARES_ROOT)"
  139. !endif
  140. !ifdef %use_watt32
  141. CFLAGS += -dUSE_WATT32 -I"$(%watt_root)/inc"
  142. !endif
  143. OBJ_BASE = WC_Win32.obj
  144. !if $(__VERSION__) > 1290
  145. OBJ_STAT = $(OBJ_BASE)/stat
  146. OBJ_DYN = $(OBJ_BASE)/dyn
  147. !else ifdef __UNIX__
  148. OBJ_STAT = $(OBJ_BASE)/stat
  149. OBJ_DYN = $(OBJ_BASE)/dyn
  150. !else
  151. OBJ_STAT = $(OBJ_BASE)\stat
  152. OBJ_DYN = $(OBJ_BASE)\dyn
  153. !endif
  154. LINK_ARG = $(OBJ_DYN)/wlink.arg
  155. LIB_ARG = $(OBJ_STAT)/wlib.arg
  156. !include Makefile.inc
  157. OBJS1 = ./$(CSOURCES:.c=.obj)
  158. OBJS2 = $(OBJS1:vtls/=)
  159. OBJS3 = $(OBJS2:vauth/=)
  160. OBJS4 = $(OBJS3: = ./)
  161. OBJS_STAT = $(OBJS4:./=$(OBJ_STAT)/)
  162. OBJS_DYN = $(OBJS4:./=$(OBJ_DYN)/)
  163. CURLBUILDH = ../include/curl/curlbuild.h
  164. RESOURCE = $(OBJ_DYN)/libcurl.res
  165. DIRS = $(OBJ_BASE) $(OBJ_BASE)/stat $(OBJ_BASE)/dyn
  166. .c : vauth vtls
  167. all: $(CURLBUILDH) $(DIRS) $(TARGETS) .SYMBOLIC
  168. @echo Welcome to libcurl
  169. clean: .SYMBOLIC
  170. -rm -f $(OBJS_STAT)
  171. -rm -f $(OBJS_DYN)
  172. -rm -f $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
  173. vclean distclean: clean .SYMBOLIC
  174. -rm -f $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
  175. -$(RD) $(OBJ_STAT)
  176. -$(RD) $(OBJ_DYN)
  177. -$(RD) $(OBJ_BASE)
  178. $(DIRS):
  179. -$(MD) $^@
  180. $(CURLBUILDH): .EXISTSONLY
  181. $(CP) $^@.dist $^@
  182. $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(__MAKEFILES__)
  183. %create $(LINK_ARG)
  184. @%append $(LINK_ARG) system nt dll
  185. !ifdef %debug
  186. @%append $(LINK_ARG) debug all
  187. @%append $(LINK_ARG) option symfile
  188. !endif
  189. @%append $(LINK_ARG) option quiet, caseexact, eliminate
  190. @%append $(LINK_ARG) option map=$(OBJ_DYN)/$(LIBNAME).map
  191. @%append $(LINK_ARG) option implib=$(LIBNAME)_imp.lib
  192. @%append $(LINK_ARG) option res=$(RESOURCE)
  193. @for %f in ($(OBJS_DYN)) do @%append $(LINK_ARG) file %f
  194. @%append $(LINK_ARG) library wldap32.lib
  195. !ifdef %use_watt32
  196. @%append $(LINK_ARG) library '$(%watt_root)/lib/wattcpw_imp.lib'
  197. !else
  198. @%append $(LINK_ARG) library ws2_32.lib
  199. !endif
  200. !ifdef %use_zlib
  201. @%append $(LINK_ARG) library '$(ZLIB_ROOT)/zlib.lib'
  202. !endif
  203. !ifdef %use_rtmp
  204. @%append $(LINK_ARG) library '$(LIBRTMP_ROOT)/librtmp/librtmp.lib'
  205. !endif
  206. !ifdef %use_ssh2
  207. @%append $(LINK_ARG) library '$(LIBSSH2_ROOT)/win32/libssh2.lib'
  208. !endif
  209. !ifdef %use_ssl
  210. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/libeay32.lib'
  211. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/ssleay32.lib'
  212. !endif
  213. !ifdef %use_ares
  214. @%append $(LINK_ARG) library '$(ARES_ROOT)/cares.lib'
  215. !endif
  216. !ifdef %use_winidn
  217. ! if $(__VERSION__) > 1290
  218. @%append $(LINK_ARG) library normaliz.lib
  219. ! else
  220. @%append $(LINK_ARG) import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
  221. @%append $(LINK_ARG) import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
  222. ! endif
  223. !endif
  224. $(LD) name $^@ @$(LINK_ARG)
  225. $(LIBNAME).lib: $(OBJS_STAT)
  226. %create $(LIB_ARG)
  227. @for %f in ($<) do @%append $(LIB_ARG) +- %f
  228. $(AR) -q -b -c -pa $^@ @$(LIB_ARG)
  229. $(RESOURCE): libcurl.rc
  230. $(RC) $(DEBUG) -q -r -zm -bt=nt -I"../include" $(SYS_INCL) $[@ -fo=$^@
  231. .c{$(OBJ_DYN)}.obj:
  232. $(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
  233. .c{$(OBJ_STAT)}.obj:
  234. $(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@