Makefile.Watcom 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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 -dHAVE_SPNEGO=1 -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_winidn
  67. CFLAGS += -dWINVER=0x0600 -dUSE_WIN32_IDN
  68. ! if $(__VERSION__) <= 1290
  69. CFLAGS += -dWANT_IDN_PROTOTYPES
  70. ! endif
  71. !endif
  72. #
  73. # Change to suite.
  74. #
  75. !ifdef %zlib_root
  76. ZLIB_ROOT = $(%zlib_root)
  77. !else
  78. ZLIB_ROOT = ../../zlib-1.2.8
  79. !endif
  80. !ifdef %libssh2_root
  81. LIBSSH2_ROOT = $(%libssh2_root)
  82. !else
  83. LIBSSH2_ROOT = ../../libssh2-1.4.3
  84. !endif
  85. !ifdef %librtmp_root
  86. LIBRTMP_ROOT = $(%librtmp_root)
  87. !else
  88. LIBRTMP_ROOT = ../../rtmpdump-2.3
  89. !endif
  90. !ifdef %openssl_root
  91. OPENSSL_ROOT = $(%openssl_root)
  92. !else
  93. OPENSSL_ROOT = ../../openssl-0.9.8y
  94. !endif
  95. !ifdef %ares_root
  96. ARES_ROOT = $(%ares_root)
  97. !else
  98. ARES_ROOT = ../ares
  99. !endif
  100. !ifdef %use_zlib
  101. CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I"$(ZLIB_ROOT)"
  102. !endif
  103. !ifdef %use_rtmp
  104. CFLAGS += -dUSE_LIBRTMP -I"$(LIBRTMP_ROOT)"
  105. !endif
  106. !ifdef %use_ssh2
  107. CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -I"$(LIBSSH2_ROOT)/include" -I"$(LIBSSH2_ROOT)/win32"
  108. !endif
  109. !ifdef %use_ssl
  110. CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I"$(OPENSSL_ROOT)/inc32"
  111. !endif
  112. !ifdef %use_ares
  113. CFLAGS += -dUSE_ARES -I"$(ARES_ROOT)"
  114. !endif
  115. !ifdef %use_watt32
  116. CFLAGS += -dUSE_WATT32 -I"$(%watt_root)/inc"
  117. !endif
  118. OBJ_BASE = WC_Win32.obj
  119. !if $(__VERSION__) > 1290
  120. OBJ_STAT = $(OBJ_BASE)/stat
  121. OBJ_DYN = $(OBJ_BASE)/dyn
  122. !else ifdef __UNIX__
  123. OBJ_STAT = $(OBJ_BASE)/stat
  124. OBJ_DYN = $(OBJ_BASE)/dyn
  125. !else
  126. OBJ_STAT = $(OBJ_BASE)\stat
  127. OBJ_DYN = $(OBJ_BASE)\dyn
  128. !endif
  129. LINK_ARG = $(OBJ_DYN)/wlink.arg
  130. LIB_ARG = $(OBJ_STAT)/wlib.arg
  131. !include Makefile.inc
  132. OBJS1 = ./$(CSOURCES:.c=.obj)
  133. OBJS2 = $(OBJS1:vtls/=)
  134. OBJS3 = $(OBJS2: = ./)
  135. OBJS_STAT = $(OBJS3:./=$(OBJ_STAT)/)
  136. OBJS_DYN = $(OBJS3:./=$(OBJ_DYN)/)
  137. CURLBUILDH = ../include/curl/curlbuild.h
  138. RESOURCE = $(OBJ_DYN)/libcurl.res
  139. DIRS = $(OBJ_BASE) $(OBJ_BASE)/stat $(OBJ_BASE)/dyn
  140. .c : vtls
  141. all: $(CURLBUILDH) $(DIRS) $(TARGETS) .SYMBOLIC
  142. @echo Welcome to libcurl
  143. clean: .SYMBOLIC
  144. -rm -f $(OBJS_STAT)
  145. -rm -f $(OBJS_DYN)
  146. -rm -f $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
  147. vclean distclean: clean .SYMBOLIC
  148. -rm -f $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
  149. -$(RD) $(OBJ_STAT)
  150. -$(RD) $(OBJ_DYN)
  151. -$(RD) $(OBJ_BASE)
  152. $(DIRS):
  153. -$(MD) $^@
  154. $(CURLBUILDH): .EXISTSONLY
  155. $(CP) $^@.dist $^@
  156. $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(__MAKEFILES__)
  157. %create $(LINK_ARG)
  158. @%append $(LINK_ARG) system nt dll
  159. !ifdef %debug
  160. @%append $(LINK_ARG) debug all
  161. @%append $(LINK_ARG) option symfile
  162. !endif
  163. @%append $(LINK_ARG) option quiet, caseexact, eliminate
  164. @%append $(LINK_ARG) option map=$(OBJ_DYN)/$(LIBNAME).map
  165. @%append $(LINK_ARG) option implib=$(LIBNAME)_imp.lib
  166. @%append $(LINK_ARG) option res=$(RESOURCE)
  167. @for %f in ($(OBJS_DYN)) do @%append $(LINK_ARG) file %f
  168. @%append $(LINK_ARG) library wldap32.lib
  169. !ifdef %use_watt32
  170. @%append $(LINK_ARG) library '$(%watt_root)/lib/wattcpw_imp.lib'
  171. !else
  172. @%append $(LINK_ARG) library ws2_32.lib
  173. !endif
  174. !ifdef %use_zlib
  175. @%append $(LINK_ARG) library '$(ZLIB_ROOT)/zlib.lib'
  176. !endif
  177. !ifdef %use_rtmp
  178. @%append $(LINK_ARG) library '$(LIBRTMP_ROOT)/librtmp/librtmp.lib'
  179. !endif
  180. !ifdef %use_ssh2
  181. @%append $(LINK_ARG) library '$(LIBSSH2_ROOT)/win32/libssh2.lib'
  182. !endif
  183. !ifdef %use_ssl
  184. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/libeay32.lib'
  185. @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/ssleay32.lib'
  186. !endif
  187. !ifdef %use_ares
  188. @%append $(LINK_ARG) library '$(ARES_ROOT)/cares.lib'
  189. !endif
  190. !ifdef %use_winidn
  191. ! if $(__VERSION__) > 1290
  192. @%append $(LINK_ARG) library normaliz.lib
  193. ! else
  194. @%append $(LINK_ARG) import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
  195. @%append $(LINK_ARG) import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
  196. ! endif
  197. !endif
  198. $(LD) name $^@ @$(LINK_ARG)
  199. $(LIBNAME).lib: $(OBJS_STAT)
  200. %create $(LIB_ARG)
  201. @for %f in ($<) do @%append $(LIB_ARG) +- %f
  202. $(AR) -q -b -c -pa $^@ @$(LIB_ARG)
  203. $(RESOURCE): libcurl.rc
  204. $(RC) $(DEBUG) -q -r -zm -bt=nt -I"../include" $(SYS_INCL) $[@ -fo=$^@
  205. .c{$(OBJ_DYN)}.obj:
  206. $(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
  207. .c{$(OBJ_STAT)}.obj:
  208. $(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@