1# 2# Watcom / OpenWatcom / Win32 makefile for cURL. 3# G. Vanem <gvanem@broadpark.no> 4# 5 6.ERASE 7 8!if $(__VERSION__) < 1280 9!message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 10!message ! This Open Watcom version is too old and is no longer supported ! 11!message ! Please download latest version from www.openwatcom.org ! 12!message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 13!error Unsupported version of Open Watcom 14!endif 15 16!ifndef %watcom 17!error WATCOM environment variable not set! 18!endif 19 20# In order to process Makefile.inc wmake must be called with -u switch! 21!ifndef %MAKEFLAGS 22!error You MUST call wmake with the -u switch! 23!endif 24 25!ifdef %libname 26LIBNAME = $(%libname) 27!else 28LIBNAME = libcurl 29!endif 30 31TARGETS = curl.exe 32 33CC = wcc386 34LD = wlink 35AR = wlib 36RC = wrc 37 38!ifdef __LOADDLL__ 39! loaddll wcc386 wccd386 40! loaddll wpp386 wppd386 41! loaddll wlib wlibd 42! loaddll wlink wlinkd 43!endif 44 45!ifdef __UNIX__ 46CP = cp 47MD = mkdir -p 48!else 49CP = copy 2>NUL 50MD = mkdir 51!endif 52!if $(__VERSION__) > 1290 53RD = rm -rf 54!else ifdef __UNIX__ 55RD = rm -rf 56!else 57RD = rmdir /q /s 2>NUL 58!endif 59 60SYS_INCL = -I"$(%watcom)/h/nt" -I"$(%watcom)/h" 61 62CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm & 63 -wcd=201 -bt=nt -bc -d+ -dWIN32 -dHAVE_STRTOLL & 64 -I"../include" -I"../lib" $(SYS_INCL) 65 66!ifdef %debug 67DEBUG = -dDEBUG=1 -dDEBUGBUILD 68CFLAGS += -d3 $(DEBUG) 69!else 70CFLAGS += -d0 71!endif 72 73!ifdef %use_ipv6 74CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6 75!endif 76 77!ifdef %use_ssl 78CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_OPENSSL -I"$(OPENSSL_ROOT)/inc32" 79!endif 80 81!ifdef %curl_static 82CFLAGS += -DCURL_STATICLIB 83!else 84CFLAGS += -br 85!endif 86 87# 88# Change to suite. 89# 90!ifdef %zlib_root 91ZLIB_ROOT = $(%zlib_root) 92!else 93ZLIB_ROOT = ../../zlib-1.2.8 94!endif 95 96!ifdef %libssh2_root 97LIBSSH2_ROOT = $(%libssh2_root) 98!else 99LIBSSH2_ROOT = ../../libssh2-1.5.0 100!endif 101 102!ifdef %librtmp_root 103LIBRTMP_ROOT = $(%librtmp_root) 104!else 105LIBRTMP_ROOT = ../../rtmpdump-2.3 106!endif 107 108!ifdef %openssl_root 109OPENSSL_ROOT = $(%openssl_root) 110!else 111OPENSSL_ROOT = ../../openssl-1.0.2a 112!endif 113 114!ifdef %ares_root 115ARES_ROOT = $(%ares_root) 116!else 117ARES_ROOT = ../ares 118!endif 119 120OBJ_DIR = WC_Win32.obj 121LINK_ARG = $(OBJ_DIR)/wlink.arg 122 123!include Makefile.inc 124 125OBJS1 = $(OBJ_DIR)/$(CURL_CFILES) 126!ifndef %curl_static 127OBJS1 += $(CURLX_CFILES:../lib/=) 128!endif 129OBJS2 = $(OBJS1: = $(OBJ_DIR)/) 130OBJS = $(OBJS2:.c=.obj) 131 132RESOURCE = $(OBJ_DIR)/curl.res 133 134DIRS = $(OBJ_DIR) 135 136all: tool_hugehelp.c $(DIRS) $(TARGETS) .SYMBOLIC 137 @echo Welcome to cURL 138 139clean: .SYMBOLIC 140 -rm -f $(OBJS) 141 -rm -f $(RESOURCE) $(LINK_ARG) 142 143vclean distclean: clean .SYMBOLIC 144 -$(RD) $(OBJ_DIR) 145 -rm -f curl.exe curl.sym tool_hugehelp.c 146 147tool_hugehelp.c: tool_hugehelp.c.cvs 148 $(CP) $[@ $^@ 149 150tool_hugehelp.c.cvs: .EXISTSONLY 151 $(CP) tool_hugehelp.c $^@ 152 153$(DIRS): 154 -$(MD) $^@ 155 156curl.exe: $(OBJS) $(RESOURCE) 157 %create $(LINK_ARG) 158 @%append $(LINK_ARG) system nt 159!ifdef %debug 160 @%append $(LINK_ARG) debug all 161 @%append $(LINK_ARG) option symfile 162!endif 163 @%append $(LINK_ARG) option quiet, caseexact, eliminate 164 @%append $(LINK_ARG) option map=$(OBJ_DIR)/$^&.map 165 @%append $(LINK_ARG) option res=$(RESOURCE) 166 @%append $(LINK_ARG) file { $(OBJS) } 167!ifndef %curl_static 168 @%append $(LINK_ARG) library ../lib/$(LIBNAME)_imp.lib 169!else 170 @%append $(LINK_ARG) library ../lib/$(LIBNAME).lib 171 @%append $(LINK_ARG) library wldap32.lib 172! ifdef %use_zlib 173 @%append $(LINK_ARG) library '$(ZLIB_ROOT)/zlib.lib' 174! endif 175! ifdef %use_rtmp 176 @%append $(LINK_ARG) library '$(LIBRTMP_ROOT)/librtmp/librtmp.lib' 177 @%append $(LINK_ARG) library winmm.lib 178! endif 179! ifdef %use_ssh2 180 @%append $(LINK_ARG) library '$(LIBSSH2_ROOT)/win32/libssh2.lib' 181! endif 182! ifdef %use_ssl 183 @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/libeay32.lib' 184 @%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/ssleay32.lib' 185! endif 186! ifdef %use_ares 187 @%append $(LINK_ARG) library '$(ARES_ROOT)/cares.lib' 188! endif 189! ifdef %use_winidn 190! if $(__VERSION__) > 1290 191 @%append $(LINK_ARG) library normaliz.lib 192! else 193 @%append $(LINK_ARG) import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii' 194 @%append $(LINK_ARG) import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode' 195! endif 196! endif 197!endif 198!ifeq USE_WATT32 1 199 @%append $(LINK_ARG) library '$(%watt_root)/lib/wattcpw_imp.lib' 200!else 201 @%append $(LINK_ARG) library ws2_32.lib 202!endif 203 $(LD) name $^@ @$(LINK_ARG) 204 205$(RESOURCE): curl.rc 206 $(RC) $(DEBUG) -q -r -zm -bt=nt -I"../include" $(SYS_INCL) $[@ -fo=$^@ 207 208# suffix search path - vpath-like hack 209.c: ../lib 210 211.c{$(OBJ_DIR)}.obj: 212 $(CC) $(CFLAGS) $[@ -fo=$^@ 213