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