Makefile.Watcom 5.6 KB

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