Makefile.Watcom 5.2 KB

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