Makefile.b32 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ############################################################
  2. #
  3. # Makefile.b32 - Borland's C++ Compiler 5.X
  4. #
  5. # 'lib' directory
  6. #
  7. # 'BCCDIR' has to be set up to point to the base directory
  8. # of the compiler, i.e. SET BCCDIR = c:\Borland\BCC55
  9. #
  10. # Initially written by Jaepil Kim, pit@paradise.net.nz
  11. ############################################################
  12. !if "$(__MAKE__)" == ""
  13. !error __MAKE__ not defined. Use Borlands's MAKE to process this makefile.
  14. !endif
  15. # Borland's $(MAKEDIR) expands to the path where make.exe is located,
  16. # use this feature to define BCCDIR when user has not defined BCCDIR.
  17. !ifndef BCCDIR
  18. BCCDIR = $(MAKEDIR)\..
  19. !endif
  20. # Edit the path below to point to the base of your Zlib sources.
  21. !ifndef ZLIB_PATH
  22. ZLIB_PATH = ..\..\zlib-1.2.8
  23. !endif
  24. # Edit the path below to point to the base of your OpenSSL package.
  25. !ifndef OPENSSL_PATH
  26. OPENSSL_PATH = ..\..\openssl-0.9.8y
  27. !endif
  28. # Set libcurl static lib, dll and import lib
  29. LIBCURL_LIB = libcurl.lib
  30. LIBCURL_DLL = libcurl.dll
  31. LIBCURL_IMPLIB = libcurl_imp.lib
  32. # Setup environment
  33. PP_CMD = cpp32 -q -P-
  34. CC_CMD = bcc32 -q -c
  35. LD = bcc32
  36. RM = del 2>NUL
  37. MKDIR = md
  38. RMDIR = rd /q
  39. LIB = tlib
  40. IMPLIB = implib
  41. CC_FLAGS = -5 -O2 -tWM -w -w-aus -w-ccc -w-dup -w-prc -w-pro -w-rch -w-sig -w-spa -w-inl -w-pia -w-pin -Dinline=__inline
  42. LIBFLAGS = /C /P32
  43. LDFLAGS = -q -lq -laa -tWD
  44. SRCDIR = .;.\vtls
  45. OBJDIR = .\BCC_objs
  46. INCDIRS = -I.;.\lib;..\include
  47. LINKLIB = $(BCCDIR)\lib\cw32mt.lib $(BCCDIR)\lib\ws2_32.lib
  48. DEFINES = -DNDEBUG -DWIN32 -DBUILDING_LIBCURL
  49. # By default SSPI support is enabled for BCC
  50. !ifndef DISABLE_SSPI
  51. DEFINES = $(DEFINES) -DUSE_WINDOWS_SSPI
  52. !endif
  53. # By default LDAP support is disabled for BCC
  54. !ifndef WITH_LDAP
  55. DEFINES = $(DEFINES) -DCURL_DISABLE_LDAP
  56. !endif
  57. # ZLIB support is enabled setting WITH_ZLIB=1
  58. !ifdef WITH_ZLIB
  59. DEFINES = $(DEFINES) -DHAVE_LIBZ -DHAVE_ZLIB_H
  60. INCDIRS = $(INCDIRS);$(ZLIB_PATH)
  61. LINKLIB = $(LINKLIB) $(ZLIB_PATH)\zlib.lib
  62. !endif
  63. # SSL support is enabled setting WITH_SSL=1
  64. !ifdef WITH_SSL
  65. DEFINES = $(DEFINES) -DUSE_SSLEAY
  66. INCDIRS = $(INCDIRS);$(OPENSSL_PATH)\inc32;$(OPENSSL_PATH)\inc32\openssl
  67. LINKLIB = $(LINKLIB) $(OPENSSL_PATH)\out32\ssleay32.lib $(OPENSSL_PATH)\out32\libeay32.lib
  68. !endif
  69. .autodepend
  70. .path.c = $(SRCDIR)
  71. .path.obj = $(OBJDIR)
  72. .path.int = $(OBJDIR)
  73. # Makefile.inc provides the CSOURCES and HHEADERS defines
  74. !include Makefile.inc
  75. # Borland's command line librarian program TLIB version 4.5 is not capable
  76. # of building a library when any of its objects contains an hypen in its
  77. # name, due to a command line parsing bug. In order to workaround this, we
  78. # build source files with hyphens in their name as objects with underscores
  79. # using explicit compilation build rules instead of implicit ones.
  80. NOHYPHEN1 = $(CSOURCES:-=_)
  81. NOHYPHEN2 = $(NOHYPHEN1:vtls/=)
  82. OBJECTS = $(NOHYPHEN2:.c=.obj)
  83. PREPROCESSED = $(NOHYPHEN2:.c=.int)
  84. # Borland's command line compiler (BCC32) version 5.5.1 integrated
  85. # preprocessor has a bug which results in silently generating wrong
  86. # definitions for libcurl macros such as CURL_OFF_T_C, on the other
  87. # hand Borland's command line preprocessor (CPP32) version 5.5.1 does
  88. # not have the bug and achieves proper results. In order to avoid the
  89. # silent bug we first preprocess source files and later compile the
  90. # preprocessed result.
  91. .c.obj:
  92. @-$(RM) $(@R).int
  93. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
  94. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  95. all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
  96. asyn_ares.obj: asyn-ares.c
  97. @-$(RM) $(@R).int
  98. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  99. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  100. asyn_thread.obj: asyn-thread.c
  101. @-$(RM) $(@R).int
  102. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  103. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  104. non_ascii.obj: non-ascii.c
  105. @-$(RM) $(@R).int
  106. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  107. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  108. clean:
  109. cd $(OBJDIR)
  110. @-$(RM) $(OBJECTS)
  111. @-$(RM) $(PREPROCESSED)
  112. cd ..
  113. @-$(RMDIR) $(OBJDIR)
  114. @-$(RM) $(LIBCURL_LIB)
  115. @-$(RM) $(LIBCURL_IMPLIB)
  116. @-$(RM) libcurl.tds
  117. $(OBJDIR):
  118. @-$(RMDIR) $(OBJDIR)
  119. @-$(MKDIR) $(OBJDIR)
  120. $(LIBCURL_LIB): $(OBJECTS)
  121. @-$(RM) $(LIBCURL_LIB)
  122. $(LIB) $(LIBFLAGS) $@ @&&!
  123. +$(**: = &^
  124. +)
  125. !
  126. $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
  127. @-$(RM) $(LIBCURL_DLL)
  128. @-$(RM) $(LIBCURL_IMPLIB)
  129. $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
  130. $(**: = ^
  131. )
  132. !
  133. $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
  134. # End of Makefile.b32