Makefile.Watcom 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 2005 - 2008, Gisle Vanem <gvanem@yahoo.no>.
  9. # Copyright (C) 2005 - 2020, 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 curl.
  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 = curl.exe
  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 __UNIX__
  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 -s -fr=con -w2 -fpi -oilrtfm &
  73. -wcd=201 -bt=nt -bc -d+ -dWIN32 -dHAVE_STRTOLL &
  74. -I"../include" -I"../lib" $(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_ssl
  85. CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_OPENSSL -I"$(OPENSSL_ROOT)/inc32"
  86. !endif
  87. !ifdef %curl_static
  88. CFLAGS += -DCURL_STATICLIB
  89. !else
  90. CFLAGS += -br
  91. !endif
  92. #
  93. # Change to suite.
  94. #
  95. !ifdef %zlib_root
  96. ZLIB_ROOT = $(%zlib_root)
  97. !else
  98. ZLIB_ROOT = ../../zlib-1.2.8
  99. !endif
  100. !ifdef %libssh2_root
  101. LIBSSH2_ROOT = $(%libssh2_root)
  102. !else
  103. LIBSSH2_ROOT = ../../libssh2-1.5.0
  104. !endif
  105. !ifdef %librtmp_root
  106. LIBRTMP_ROOT = $(%librtmp_root)
  107. !else
  108. LIBRTMP_ROOT = ../../rtmpdump-2.3
  109. !endif
  110. !ifdef %openssl_root
  111. OPENSSL_ROOT = $(%openssl_root)
  112. !else
  113. OPENSSL_ROOT = ../../openssl-1.0.2a
  114. !endif
  115. !ifdef %ares_root
  116. ARES_ROOT = $(%ares_root)
  117. !else
  118. ARES_ROOT = ../ares
  119. !endif
  120. OBJ_DIR = WC_Win32.obj
  121. LINK_ARG = $(OBJ_DIR)/wlink.arg
  122. !include Makefile.inc
  123. OBJS1 = $(OBJ_DIR)/$(CURL_CFILES)
  124. !ifndef %curl_static
  125. OBJS1 += $(CURLX_CFILES:../lib/=)
  126. !endif
  127. OBJS2 = $(OBJS1: = $(OBJ_DIR)/)
  128. OBJS = $(OBJS2:.c=.obj)
  129. RESOURCE = $(OBJ_DIR)/curl.res
  130. DIRS = $(OBJ_DIR)
  131. all: tool_hugehelp.c $(DIRS) $(TARGETS) .SYMBOLIC
  132. @echo Welcome to curl
  133. clean: .SYMBOLIC
  134. -rm -f $(OBJS)
  135. -rm -f $(RESOURCE) $(LINK_ARG)
  136. vclean distclean: clean .SYMBOLIC
  137. -$(RD) $(OBJ_DIR)
  138. -rm -f curl.exe curl.sym tool_hugehelp.c
  139. tool_hugehelp.c: tool_hugehelp.c.cvs
  140. $(CP) $[@ $^@
  141. tool_hugehelp.c.cvs: .EXISTSONLY
  142. $(CP) tool_hugehelp.c $^@
  143. $(DIRS):
  144. -$(MD) $^@
  145. curl.exe: $(OBJS) $(RESOURCE)
  146. %create $(LINK_ARG)
  147. @%append $(LINK_ARG) system nt
  148. !ifdef %debug
  149. @%append $(LINK_ARG) debug all
  150. @%append $(LINK_ARG) option symfile
  151. !endif
  152. @%append $(LINK_ARG) option quiet, caseexact, eliminate
  153. @%append $(LINK_ARG) option map=$(OBJ_DIR)/$^&.map
  154. @%append $(LINK_ARG) option res=$(RESOURCE)
  155. @%append $(LINK_ARG) file { $(OBJS) }
  156. !ifndef %curl_static
  157. @%append $(LINK_ARG) library ../lib/$(LIBNAME)_imp.lib
  158. !else
  159. @%append $(LINK_ARG) library ../lib/$(LIBNAME).lib
  160. @%append $(LINK_ARG) library wldap32.lib
  161. ! ifdef %use_zlib
  162. @%append $(LINK_ARG) library '$(ZLIB_ROOT)/zlib.lib'
  163. ! endif
  164. ! ifdef %use_rtmp
  165. @%append $(LINK_ARG) library '$(LIBRTMP_ROOT)/librtmp/librtmp.lib'
  166. @%append $(LINK_ARG) library winmm.lib
  167. ! endif
  168. ! ifdef %use_ssh2
  169. @%append $(LINK_ARG) library '$(LIBSSH2_ROOT)/win32/libssh2.lib'
  170. ! endif
  171. ! ifdef %use_ssl
  172. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/libeay32.lib'
  173. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/ssleay32.lib'
  174. ! endif
  175. ! ifdef %use_ares
  176. @%append $(LINK_ARG) library '$(ARES_ROOT)/cares.lib'
  177. ! endif
  178. ! ifdef %use_winidn
  179. ! if $(__VERSION__) > 1290
  180. @%append $(LINK_ARG) library normaliz.lib
  181. ! else
  182. @%append $(LINK_ARG) import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
  183. @%append $(LINK_ARG) import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
  184. ! endif
  185. ! endif
  186. !endif
  187. !ifeq USE_WATT32 1
  188. @%append $(LINK_ARG) library '$(%watt_root)/lib/wattcpw_imp.lib'
  189. !else
  190. @%append $(LINK_ARG) library ws2_32.lib
  191. !endif
  192. $(LD) name $^@ @$(LINK_ARG)
  193. $(RESOURCE): curl.rc
  194. $(RC) $(DEBUG) -q -r -zm -bt=nt -I"../include" $(SYS_INCL) $[@ -fo=$^@
  195. # suffix search path - vpath-like hack
  196. .c: ../lib
  197. .c{$(OBJ_DIR)}.obj:
  198. $(CC) $(CFLAGS) $[@ -fo=$^@