geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

191 lines
4.1 KiB

  1. #
  2. # Watcom / OpenWatcom Win32 makefile for libssh2.
  3. #
  4. # Comments to: Guenter Knauf http://www.gknw.net/phpbb
  5. #
  6. !ifndef %watcom
  7. !error WATCOM environment variable not set!
  8. !else
  9. SYS_INCL = -I$(%watcom)\h\nt -I$(%watcom)\h
  10. SYS_LIBS = $(%watcom)\lib386\nt;$(%watcom)\lib386
  11. !endif
  12. !ifdef %libname
  13. LIBNAME = $(%libname)
  14. !else
  15. LIBNAME = libssh2
  16. !endif
  17. TARGETS = $(LIBNAME).dll $(LIBNAME)_imp.lib $(LIBNAME).lib
  18. CC = wcc386
  19. LD = wlink
  20. AR = wlib
  21. RC = wrc
  22. !ifdef __LOADDLL__
  23. ! loaddll wcc386 wccd386
  24. ! loaddll wpp386 wppd386
  25. ! loaddll wlib wlibd
  26. ! if $(__VERSION__) > 1270
  27. ! loaddll wlink wlinkd
  28. ! else
  29. ! loaddll wlink wlink
  30. ! endif
  31. !endif
  32. !if $(__VERSION__) < 1250
  33. RM = del /q /f 2>NUL
  34. !else
  35. RM = rm -f
  36. !endif
  37. MD = mkdir
  38. RD = rmdir /q /s 2>NUL
  39. CP = copy
  40. CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=nul -w2 -fpi -oilrtfm &
  41. -wcd=201 -bt=nt -d+ -dWIN32 -DLIBSSH2_WIN32 &
  42. -I. -I..\include $(SYS_INCL)
  43. !ifdef %debug
  44. DEBUG = -dDEBUG=1 -dDEBUGBUILD
  45. CFLAGS += -d3 $(DEBUG)
  46. !else
  47. CFLAGS += -d0
  48. !endif
  49. !ifdef %use_ipv6
  50. CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
  51. !endif
  52. #
  53. # Change to suite.
  54. #
  55. !ifdef %zlib_root
  56. ZLIB_ROOT = $(%zlib_root)
  57. !else
  58. ZLIB_ROOT = ..\..\zlib-1.2.8
  59. !endif
  60. !ifdef %openssl_root
  61. OPENSSL_ROOT = $(%openssl_root)
  62. !else
  63. OPENSSL_ROOT = ..\..\openssl-0.9.8zc
  64. !endif
  65. !ifdef %use_zlib
  66. CFLAGS += -DLIBSSH2_HAVE_ZLIB -I$(ZLIB_ROOT)
  67. !endif
  68. !ifdef %use_wincng
  69. CFLAGS += -DLIBSSH2_WINCNG
  70. !else
  71. CFLAGS += -wcd=138 -dLIBSSH2_OPENSSL -I$(OPENSSL_ROOT)\inc32
  72. !endif
  73. !ifdef %use_watt32
  74. CFLAGS += -dUSE_WATT32 -I$(%watt_root)\inc
  75. !endif
  76. OBJ_BASE = WC_Win32.obj
  77. LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
  78. LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
  79. # In order to process Makefile.inc wmake must be called with -u switch!
  80. !ifndef %MAKEFLAGS
  81. !error You MUST call wmake with the -u switch!
  82. !else
  83. !ifdef %use_wincng
  84. !include ..\Makefile.WinCNG.inc
  85. !else
  86. !include ..\Makefile.OpenSSL.inc
  87. !endif
  88. !include ..\Makefile.inc
  89. !endif
  90. OBJS = $(CSOURCES:.c=.obj)
  91. OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\)
  92. #
  93. # Use $(OBJS) as a template to generate $(OBJS_STAT) and $(OBJS_DYN).
  94. #
  95. OBJ_DIR = $(OBJ_BASE)\stat
  96. OBJS_STAT = $+ $(OBJS) $-
  97. OBJ_DIR = $(OBJ_BASE)\dyn
  98. OBJS_DYN = $+ $(OBJS) $-
  99. RESOURCE = $(OBJ_BASE)\dyn\libssh2.res
  100. .c: ..\src
  101. all: $(OBJ_BASE) $(TARGETS) .SYMBOLIC
  102. @echo Welcome to libssh2
  103. clean: .SYMBOLIC
  104. -$(RM) $(OBJS_STAT)
  105. -$(RM) $(OBJS_DYN)
  106. -$(RM) $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
  107. vclean realclean: clean .SYMBOLIC
  108. -$(RM) $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
  109. -$(RD) $(OBJ_BASE)\stat
  110. -$(RD) $(OBJ_BASE)\dyn
  111. -$(RD) $(OBJ_BASE)
  112. $(OBJ_BASE):
  113. -$(MD) $^@
  114. -$(MD) $^@\stat
  115. -$(MD) $^@\dyn
  116. $(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(LINK_ARG)
  117. $(LD) name $^@ @$]@
  118. $(LIBNAME).lib: $(OBJS_STAT) $(LIB_ARG)
  119. $(AR) -q -b -c $^@ @$]@
  120. .ERASE
  121. $(RESOURCE): libssh2.rc
  122. $(RC) $(DEBUG) -q -r -zm -I..\include $(SYS_INCL) $[@ -fo=$^@
  123. .ERASE
  124. .c{$(OBJ_BASE)\dyn}.obj:
  125. $(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
  126. .ERASE
  127. .c{$(OBJ_BASE)\stat}.obj:
  128. $(CC) $(CFLAGS) $[@ -fo=$^@
  129. $(LINK_ARG): $(__MAKEFILES__)
  130. %create $^@
  131. @%append $^@ system nt dll
  132. @%append $^@ file { $(OBJS_DYN) }
  133. !ifdef %debug
  134. @%append $^@ debug all
  135. @%append $^@ option symfile
  136. !endif
  137. @%append $^@ option quiet, map, caseexact, eliminate, implib=$(LIBNAME)_imp.lib,
  138. @%append $^@ res=$(RESOURCE) libpath $(SYS_LIBS)
  139. !ifdef %use_watt32
  140. @%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib
  141. !else
  142. @%append $^@ library ws2_32.lib
  143. !endif
  144. !ifdef %use_zlib
  145. @%append $^@ library '$(ZLIB_ROOT)\zlib.lib'
  146. !endif
  147. !ifdef %use_wincng
  148. @%append $^@ library bcrypt.lib
  149. @%append $^@ library crypt32.lib
  150. !else
  151. @%append $^@ library '$(OPENSSL_ROOT)\out32\libeay32.lib'
  152. @%append $^@ library '$(OPENSSL_ROOT)\out32\ssleay32.lib'
  153. !endif
  154. $(LIB_ARG): $(__MAKEFILES__)
  155. %create $^@
  156. @for %f in ($(OBJS_STAT)) do @%append $^@ +- %f