common.dj 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #
  2. # Common defines for curl (djgpp/Watt-32)
  3. #
  4. # Assumes you've unpacked curl with long-file names
  5. # I.e use "set LFN=y" before untaring on Win9x/XP.
  6. # Requires sed, yacc, rm and the usual stuff.
  7. #
  8. # Define TOPDIR before including this file.
  9. .SUFFIXES: .exe .y
  10. MAKEFILE = Makefile.dj
  11. OBJ_DIR = djgpp
  12. #
  13. # Find out if using a Unix-like shell or a DOS command interpreter
  14. #
  15. ifneq ($(findstring COMMAND.COM,$(SHELL)),COMMAND.COM)
  16. ifneq ($(findstring CMD.EXE,$(SHELL)),CMD.EXE)
  17. ifneq ($(findstring 4DOS.COM,$(SHELL)),4DOS.COM)
  18. IS_UNIX_SHELL = 1
  19. endif
  20. endif
  21. endif
  22. #
  23. # Define shell dependent commands and vars
  24. #
  25. ifeq ($(IS_UNIX_SHELL),1)
  26. COPY = cp -f
  27. DELETE = rm -f
  28. MKDIR = mkdir
  29. RMDIR = rm -f -r
  30. DS = /
  31. else
  32. COPY = copy
  33. DELETE = del
  34. MKDIR = mkdir
  35. RMDIR = rmdir
  36. DS = \$(NOTHING)
  37. endif
  38. #
  39. # OpenSSL is available from www.openssl.org and builds okay
  40. # with djgpp/Watt-32. Set to 0 if you don't need https URLs
  41. # (reduces curl.exe with approx 700 kB)
  42. #
  43. USE_SSL = 0
  44. #
  45. # Use zlib for contents encoding
  46. #
  47. USE_ZLIB = 0
  48. #
  49. # Use libidn for international domain names
  50. #
  51. USE_IDNA = 0
  52. #
  53. # Use Watt-32 IPv6 stack (only IPv6 name resolution working at the moment)
  54. #
  55. USE_IPV6 = 0
  56. #
  57. # Use C-Ares resolver library
  58. #
  59. USE_ARES = 0
  60. #
  61. # Enable debug code in libcurl/curl
  62. #
  63. USE_DEBUG = 0
  64. #
  65. # Enable memory tracking code in libcurl/curl
  66. #
  67. USE_CURLDEBUG = 0
  68. default: all
  69. #
  70. # Root directory for Waterloo tcp/ip etc. Change to suite.
  71. # WATT_ROOT should be set during Watt-32 install.
  72. #
  73. WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
  74. OPENSSL_ROOT = e:/net/openssl.099
  75. ZLIB_ROOT = $(DJDIR)/contrib/zlib
  76. LIBIDN_ROOT = $(TOPDIR)/../IDN/libidn
  77. ARES_ROOT = $(TOPDIR)/ares
  78. CC = gcc
  79. YACC = bison -y
  80. CFLAGS = -g -O2 -I. -I$(TOPDIR)/include -I$(TOPDIR)/lib \
  81. -I$(WATT32_ROOT)/inc -Wall -DHAVE_CONFIG_H
  82. ifeq ($(USE_SSL),1)
  83. CFLAGS += -DUSE_OPENSSL -I$(OPENSSL_ROOT)
  84. endif
  85. ifeq ($(USE_ZLIB),1)
  86. CFLAGS += -DUSE_ZLIB -I$(ZLIB_ROOT)
  87. endif
  88. ifeq ($(USE_IPV6),1)
  89. CFLAGS += -DENABLE_IPV6
  90. endif
  91. ifeq ($(USE_ARES),1)
  92. CFLAGS += -DUSE_ARES -I$(ARES_ROOT)
  93. endif
  94. ifeq ($(USE_IDNA),1)
  95. CFLAGS += -DHAVE_LIBIDN -DHAVE_IDN_FREE_H -DHAVE_IDN_FREE -DHAVE_TLD_H \
  96. -DHAVE_TLD_STRERROR -I$(LIBIDN_ROOT)/lib
  97. endif
  98. ifeq ($(USE_DEBUG),1)
  99. CFLAGS += -DDEBUG=1 -DDEBUGBUILD
  100. endif
  101. ifeq ($(USE_CURLDEBUG),1)
  102. CFLAGS += -DCURLDEBUG
  103. endif
  104. $(OBJ_DIR):
  105. $(MKDIR) $(OBJ_DIR)
  106. $(OBJ_DIR)/%.o: %.c
  107. $(CC) $(CFLAGS) -o $@ -c $<
  108. @echo
  109. depend: $(DEPEND_PREREQ) $(MAKEFILE)
  110. $(CC) -MM $(CFLAGS) $(CSOURCES) | \
  111. sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj