common.dj 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. ###########################################################################
  22. #
  23. # Common defines for curl (djgpp/Watt-32)
  24. #
  25. # Assumes you've unpacked curl with long-file names
  26. # I.e use "set LFN=y" before untaring on Win9x/XP.
  27. # Requires sed, yacc, rm and the usual stuff.
  28. #
  29. # Define TOPDIR before including this file.
  30. .SUFFIXES: .exe .y
  31. MAKEFILE = Makefile.dj
  32. OBJ_DIR = djgpp
  33. #
  34. # Find out if using a Unix-like shell or a DOS command interpreter
  35. #
  36. ifneq ($(findstring COMMAND.COM,$(SHELL)),COMMAND.COM)
  37. ifneq ($(findstring CMD.EXE,$(SHELL)),CMD.EXE)
  38. ifneq ($(findstring 4DOS.COM,$(SHELL)),4DOS.COM)
  39. IS_UNIX_SHELL = 1
  40. endif
  41. endif
  42. endif
  43. #
  44. # Define shell dependent commands and vars
  45. #
  46. ifeq ($(IS_UNIX_SHELL),1)
  47. COPY = cp -f
  48. DELETE = rm -f
  49. MKDIR = mkdir
  50. RMDIR = rm -f -r
  51. DS = /
  52. else
  53. COPY = copy
  54. DELETE = del
  55. MKDIR = mkdir
  56. RMDIR = rmdir
  57. DS = \$(NOTHING)
  58. endif
  59. #
  60. # OpenSSL is available from www.openssl.org and builds okay
  61. # with djgpp/Watt-32. Set to 0 if you don't need https URLs
  62. # (reduces curl.exe with approx 700 kB)
  63. #
  64. USE_SSL = 0
  65. #
  66. # Use zlib for contents encoding
  67. #
  68. USE_ZLIB = 0
  69. #
  70. # Use libidn for international domain names
  71. #
  72. USE_IDNA = 0
  73. #
  74. # Use Watt-32 IPv6 stack (only IPv6 name resolution working at the moment)
  75. #
  76. USE_IPV6 = 0
  77. #
  78. # Use C-Ares resolver library
  79. #
  80. USE_ARES = 0
  81. #
  82. # Enable debug code in libcurl/curl
  83. #
  84. USE_DEBUG = 0
  85. #
  86. # Enable memory tracking code in libcurl/curl
  87. #
  88. USE_CURLDEBUG = 0
  89. default: all
  90. #
  91. # Root directory for Waterloo tcp/ip etc. Change to suite.
  92. # WATT_ROOT should be set during Watt-32 install.
  93. #
  94. WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
  95. OPENSSL_ROOT = e:/net/openssl.099
  96. ZLIB_ROOT = $(DJDIR)/contrib/zlib
  97. LIBIDN_ROOT = $(TOPDIR)/../IDN/libidn
  98. ARES_ROOT = $(TOPDIR)/ares
  99. CC = gcc
  100. YACC = bison -y
  101. CFLAGS = -g -O2 -I. -I$(TOPDIR)/include -I$(TOPDIR)/lib \
  102. -I$(WATT32_ROOT)/inc -Wall -DHAVE_CONFIG_H
  103. ifeq ($(USE_SSL),1)
  104. CFLAGS += -DUSE_OPENSSL -I$(OPENSSL_ROOT)
  105. endif
  106. ifeq ($(USE_ZLIB),1)
  107. CFLAGS += -DUSE_ZLIB -I$(ZLIB_ROOT)
  108. endif
  109. ifeq ($(USE_IPV6),1)
  110. CFLAGS += -DENABLE_IPV6
  111. endif
  112. ifeq ($(USE_ARES),1)
  113. CFLAGS += -DUSE_ARES -I$(ARES_ROOT)
  114. endif
  115. ifeq ($(USE_IDNA),1)
  116. CFLAGS += -DHAVE_LIBIDN -DHAVE_IDN_FREE_H -DHAVE_IDN_FREE -DHAVE_TLD_H \
  117. -DHAVE_TLD_STRERROR -I$(LIBIDN_ROOT)/lib
  118. endif
  119. ifeq ($(USE_DEBUG),1)
  120. CFLAGS += -DDEBUG=1 -DDEBUGBUILD
  121. endif
  122. ifeq ($(USE_CURLDEBUG),1)
  123. CFLAGS += -DCURLDEBUG
  124. endif
  125. $(OBJ_DIR):
  126. $(MKDIR) $(OBJ_DIR)
  127. $(OBJ_DIR)/%.o: %.c
  128. $(CC) $(CFLAGS) -o $@ -c $<
  129. @echo
  130. depend: $(DEPEND_PREREQ) $(MAKEFILE)
  131. $(CC) -MM $(CFLAGS) $(CSOURCES) | \
  132. sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj