Makefile.vc6 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. #############################################################
  2. #
  3. # Makefile for building libcurl with MSVC6
  4. #
  5. # Usage: see usage message below
  6. # Should be invoked from \lib directory
  7. # Edit the paths and desired library name
  8. # SSL path is only required if you intend compiling
  9. # with SSL.
  10. #
  11. # This make file leaves the result either a .lib or .dll file
  12. # in the \lib directory. It should be called from the \lib
  13. # directory.
  14. #
  15. # An option would have been to allow the source directory to
  16. # be specified, but I saw no requirement.
  17. #
  18. # Another option would have been to leave the .lib and .dll
  19. # files in the "cfg" directory, but then the make file
  20. # in \src would need to be changed.
  21. #
  22. ##############################################################
  23. # CHANGE LOG
  24. # ------------------------------------------------------------
  25. # 05.11.2001 John Lask Initial Release
  26. # 02.05.2002 Miklos Nemeth OPENSSL_PATH environment; no need
  27. # for OpenSSL libraries when creating a
  28. # static libcurl.lib
  29. # 10.14.2003 Added a target release-libcurl-ssl-dll which
  30. # is intended to allow static linking of libcurl with dynamic
  31. # linking of openssl
  32. ##############################################################
  33. LIB_NAME = libcurl
  34. LIB_NAME_DEBUG = libcurld
  35. !IFNDEF OPENSSL_PATH
  36. OPENSSL_PATH = ../../openssl-0.9.7a
  37. !ENDIF
  38. #############################################################
  39. ## Nothing more to do below this line!
  40. CCNODBG = cl.exe /MD /O2 /D "NDEBUG"
  41. CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D "_DEBUG" /GZ
  42. CFLAGSSSL = /D "USE_SSLEAY" /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
  43. CFLAGS = /I "." /I "../include" /nologo /W3 /GX /D "WIN32" /D "VC6" /D "_MBCS" /D "_LIB" /YX /FD /c /D "MSDOS"
  44. LNKDLL = link.exe /DLL /def:libcurl.def
  45. LNKLIB = link.exe /lib
  46. LFLAGS = /nologo
  47. SSLLIBS = libeay32.lib ssleay32.lib
  48. # RSAglue.lib was formerly needed in the SSLLIBS
  49. CFGSET = FALSE
  50. ######################
  51. # release
  52. !IF "$(CFG)" == "release"
  53. TARGET =$(LIB_NAME).lib
  54. DIROBJ =.\$(CFG)
  55. LNK = $(LNKLIB) /out:$(TARGET)
  56. CC = $(CCNODBG)
  57. CFGSET = TRUE
  58. !ENDIF
  59. ######################
  60. # release-dll
  61. !IF "$(CFG)" == "release-dll"
  62. TARGET =$(LIB_NAME).dll
  63. DIROBJ =.\$(CFG)
  64. LNK = $(LNKDLL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
  65. CC = $(CCNODBG)
  66. CFGSET = TRUE
  67. RESOURCE = $(DIROBJ)\libcurl.res
  68. !ENDIF
  69. ######################
  70. # release-ssl
  71. !IF "$(CFG)" == "release-ssl"
  72. TARGET =$(LIB_NAME).lib
  73. DIROBJ =.\$(CFG)
  74. LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32"
  75. LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
  76. CC = $(CCNODBG) $(CFLAGSSSL)
  77. CFGSET = TRUE
  78. !ENDIF
  79. ######################
  80. # release-ssl-dll
  81. !IF "$(CFG)" == "release-ssl-dll"
  82. TARGET =$(LIB_NAME).dll
  83. DIROBJ =.\$(CFG)
  84. LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
  85. LNK = $(LNKDLL) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
  86. CC = $(CCNODBG) $(CFLAGSSSL)
  87. CFGSET = TRUE
  88. RESOURCE = $(DIROBJ)\libcurl.res
  89. !ENDIF
  90. ######################
  91. # release-libcurl-ssl-dll
  92. !IF "$(CFG)" == "release-libcurl-ssl-dll"
  93. TARGET =$(LIB_NAME).lib
  94. DIROBJ =.\$(CFG)
  95. LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
  96. LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
  97. CC = $(CCNODBG) $(CFLAGSSSL)
  98. CFGSET = TRUE
  99. RESOURCE = $(DIROBJ)\libcurl.res
  100. !ENDIF
  101. ######################
  102. # debug
  103. !IF "$(CFG)" == "debug"
  104. TARGET =$(LIB_NAME_DEBUG).lib
  105. DIROBJ =.\$(CFG)
  106. LNK = $(LNKLIB) /out:$(TARGET)
  107. CC = $(CCDEBUG)
  108. CFGSET = TRUE
  109. !ENDIF
  110. ######################
  111. # debug-dll
  112. !IF "$(CFG)" == "debug-dll"
  113. TARGET =$(LIB_NAME_DEBUG).dll
  114. DIROBJ =.\$(CFG)
  115. LNK = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
  116. CC = $(CCDEBUG)
  117. CFGSET = TRUE
  118. RESOURCE = $(DIROBJ)\libcurl.res
  119. !ENDIF
  120. ######################
  121. # debug-ssl
  122. #todo
  123. !IF "$(CFG)" == "debug-ssl"
  124. TARGET = $(LIB_NAME_DEBUG).lib
  125. DIROBJ =.\$(CFG)
  126. LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(TARGET)
  127. CC = $(CCDEBUG) $(CFLAGSSSL)
  128. CFGSET = TRUE
  129. !ENDIF
  130. ######################
  131. # debug-ssl-dll
  132. !IF "$(CFG)" == "debug-ssl-dll"
  133. TARGET =$(LIB_NAME_DEBUG).dll
  134. DIROBJ =.\$(CFG)
  135. LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
  136. LNK = $(LNKDLL) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
  137. CC = $(CCDEBUG) $(CFLAGSSSL)
  138. CFGSET = TRUE
  139. RESOURCE = $(DIROBJ)\libcurl.res
  140. !ENDIF
  141. #######################
  142. # Usage
  143. #
  144. !IF "$(CFGSET)" == "FALSE"
  145. !MESSAGE Usage: nmake /f makefile.vc6 CFG=<config> <target>
  146. !MESSAGE where <config> is one of:
  147. !MESSAGE release - release static library
  148. !MESSAGE release-dll - release dll
  149. !MESSAGE release-ssl - release static library with ssl
  150. !MESSAGE release-ssl-dll - release dll library with ssl
  151. !MESSAGE release-libcurl-ssl-dll - static libcurl with shared ssl
  152. !MESSAGE debug - debug static library
  153. !MESSAGE debug-dll - debug dll
  154. !MESSAGE debug-ssl - debug static library with ssl
  155. !MESSAGE debug-ssl-dll - debug dll library with ssl
  156. !MESSAGE <target> can be left blank in which case all is assumed
  157. !ERROR please choose a valid configuration "$(CFG)"
  158. !ENDIF
  159. #######################
  160. #
  161. X_OBJS= \
  162. $(DIROBJ)\base64.obj \
  163. $(DIROBJ)\cookie.obj \
  164. $(DIROBJ)\transfer.obj \
  165. $(DIROBJ)\escape.obj \
  166. $(DIROBJ)\formdata.obj \
  167. $(DIROBJ)\ftp.obj \
  168. $(DIROBJ)\http.obj \
  169. $(DIROBJ)\http_chunks.obj \
  170. $(DIROBJ)\ldap.obj \
  171. $(DIROBJ)\dict.obj \
  172. $(DIROBJ)\telnet.obj \
  173. $(DIROBJ)\getdate.obj \
  174. $(DIROBJ)\getenv.obj \
  175. $(DIROBJ)\inet_pton.obj \
  176. $(DIROBJ)\hostip.obj \
  177. $(DIROBJ)\if2ip.obj \
  178. $(DIROBJ)\mprintf.obj \
  179. $(DIROBJ)\netrc.obj \
  180. $(DIROBJ)\progress.obj \
  181. $(DIROBJ)\sendf.obj \
  182. $(DIROBJ)\speedcheck.obj \
  183. $(DIROBJ)\ssluse.obj \
  184. $(DIROBJ)\timeval.obj \
  185. $(DIROBJ)\url.obj \
  186. $(DIROBJ)\file.obj \
  187. $(DIROBJ)\getinfo.obj \
  188. $(DIROBJ)\version.obj \
  189. $(DIROBJ)\easy.obj \
  190. $(DIROBJ)\strequal.obj \
  191. $(DIROBJ)\strtok.obj \
  192. $(DIROBJ)\strtoofft.obj \
  193. $(DIROBJ)\connect.obj \
  194. $(DIROBJ)\hash.obj \
  195. $(DIROBJ)\llist.obj \
  196. $(DIROBJ)\share.obj \
  197. $(DIROBJ)\multi.obj \
  198. $(DIROBJ)\http_digest.obj \
  199. $(DIROBJ)\http_negotiate.obj \
  200. $(DIROBJ)\http_ntlm.obj \
  201. $(DIROBJ)\md5.obj \
  202. $(DIROBJ)\curl_strerror.obj \
  203. $(RESOURCE)
  204. all : $(TARGET)
  205. $(TARGET): $(X_OBJS)
  206. $(LNK) $(LFLAGS) $(X_OBJS)
  207. $(X_OBJS): $(DIROBJ)
  208. $(DIROBJ):
  209. @if not exist "$(DIROBJ)" mkdir $(DIROBJ)
  210. .SUFFIXES: .c .obj .res
  211. {.\}.c{$(DIROBJ)\}.obj:
  212. $(CC) $(CFLAGS) /Fo"$@" $<
  213. debug-dll\libcurl.res \
  214. debug-ssl-dll\libcurl.res \
  215. release-libcurl-ssl-dll\libcurl.res: libcurl.rc
  216. rc /dCURLDEBUG=1 /Fo $@ libcurl.rc
  217. release-dll\libcurl.res \
  218. release-ssl-dll\libcurl.res \
  219. release-libcurl-ssl-dll\libcurl.res: libcurl.rc
  220. rc /dCURLDEBUG=0 /Fo $@ libcurl.rc
  221. clean:
  222. -@erase $(DIROBJ)\*.obj
  223. -@erase $(DIROBJ)\*.res
  224. -@erase vc60.idb
  225. -@erase vc60.pch