2
0

Makefile.b32 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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 = .
  45. OBJDIR = .\BCC_objs
  46. INCDIRS = -I.;..\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. NOHYPHEN = $(CSOURCES:-=_)
  81. OBJECTS = $(NOHYPHEN:.c=.obj)
  82. PREPROCESSED = $(NOHYPHEN:.c=.int)
  83. # Borland's command line compiler (BCC32) version 5.5.1 integrated
  84. # preprocessor has a bug which results in silently generating wrong
  85. # definitions for libcurl macros such as CURL_OFF_T_C, on the other
  86. # hand Borland's command line preprocessor (CPP32) version 5.5.1 does
  87. # not have the bug and achieves proper results. In order to avoid the
  88. # silent bug we first preprocess source files and later compile the
  89. # preprocessed result.
  90. .c.obj:
  91. @-$(RM) $(@R).int
  92. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(<)
  93. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  94. all: $(OBJDIR) $(LIBCURL_LIB) $(LIBCURL_DLL)
  95. asyn_ares.obj: asyn-ares.c
  96. @-$(RM) $(@R).int
  97. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  98. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  99. asyn_thread.obj: asyn-thread.c
  100. @-$(RM) $(@R).int
  101. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  102. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  103. non_ascii.obj: non-ascii.c
  104. @-$(RM) $(@R).int
  105. $(PP_CMD) $(CC_FLAGS) $(INCDIRS) $(DEFINES) -o$(@R).int $(?)
  106. $(CC_CMD) $(CC_FLAGS) -o$(@) $(@R).int
  107. clean:
  108. cd $(OBJDIR)
  109. @-$(RM) $(OBJECTS)
  110. @-$(RM) $(PREPROCESSED)
  111. cd ..
  112. @-$(RMDIR) $(OBJDIR)
  113. @-$(RM) $(LIBCURL_LIB)
  114. @-$(RM) $(LIBCURL_IMPLIB)
  115. @-$(RM) libcurl.tds
  116. $(OBJDIR):
  117. @-$(RMDIR) $(OBJDIR)
  118. @-$(MKDIR) $(OBJDIR)
  119. $(LIBCURL_LIB): $(OBJECTS)
  120. @-$(RM) $(LIBCURL_LIB)
  121. $(LIB) $(LIBFLAGS) $@ @&&!
  122. +$(**: = &^
  123. +)
  124. !
  125. $(LIBCURL_DLL) $(LIBCURL_IMPLIB): $(OBJECTS) $(LINKLIB)
  126. @-$(RM) $(LIBCURL_DLL)
  127. @-$(RM) $(LIBCURL_IMPLIB)
  128. $(LD) $(LDFLAGS) -e$(LIBCURL_DLL) @&&!
  129. $(**: = ^
  130. )
  131. !
  132. $(IMPLIB) $(LIBCURL_IMPLIB) $(LIBCURL_DLL)
  133. # End of Makefile.b32