Home | History | Annotate | Download | only in src
      1 #
      2 #  Watcom / OpenWatcom / Win32 makefile for cURL.
      3 #  G. Vanem <gvanem (at] 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
     26 LIBNAME = $(%libname)
     27 !else
     28 LIBNAME = libcurl
     29 !endif
     30 
     31 TARGETS = curl.exe
     32 
     33 CC = wcc386
     34 LD = wlink
     35 AR = wlib
     36 RC = 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__
     46 CP = cp
     47 MD = mkdir -p
     48 !else
     49 CP = copy 2>NUL
     50 MD = mkdir
     51 !endif
     52 !if $(__VERSION__) > 1290
     53 RD = rm -rf
     54 !else ifdef __UNIX__
     55 RD = rm -rf
     56 !else
     57 RD = rmdir /q /s 2>NUL
     58 !endif
     59 
     60 SYS_INCL = -I"$(%watcom)/h/nt" -I"$(%watcom)/h"
     61 
     62 CFLAGS = -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
     67 DEBUG  = -dDEBUG=1 -dDEBUGBUILD
     68 CFLAGS += -d3 $(DEBUG)
     69 !else
     70 CFLAGS += -d0
     71 !endif
     72 
     73 !ifdef %use_ipv6
     74 CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
     75 !endif
     76 
     77 !ifdef %use_ssl
     78 CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_OPENSSL -I"$(OPENSSL_ROOT)/inc32"
     79 !endif
     80 
     81 !ifdef %curl_static
     82 CFLAGS += -DCURL_STATICLIB
     83 !else
     84 CFLAGS += -br
     85 !endif
     86 
     87 #
     88 # Change to suite.
     89 #
     90 !ifdef %zlib_root
     91 ZLIB_ROOT = $(%zlib_root)
     92 !else
     93 ZLIB_ROOT = ../../zlib-1.2.8
     94 !endif
     95 
     96 !ifdef %libssh2_root
     97 LIBSSH2_ROOT = $(%libssh2_root)
     98 !else
     99 LIBSSH2_ROOT = ../../libssh2-1.5.0
    100 !endif
    101 
    102 !ifdef %librtmp_root
    103 LIBRTMP_ROOT = $(%librtmp_root)
    104 !else
    105 LIBRTMP_ROOT = ../../rtmpdump-2.3
    106 !endif
    107 
    108 !ifdef %openssl_root
    109 OPENSSL_ROOT = $(%openssl_root)
    110 !else
    111 OPENSSL_ROOT = ../../openssl-1.0.2a
    112 !endif
    113 
    114 !ifdef %ares_root
    115 ARES_ROOT = $(%ares_root)
    116 !else
    117 ARES_ROOT = ../ares
    118 !endif
    119 
    120 OBJ_DIR  = WC_Win32.obj
    121 LINK_ARG = $(OBJ_DIR)/wlink.arg
    122 
    123 !include Makefile.inc
    124 
    125 OBJS1 = $(OBJ_DIR)/$(CURL_CFILES)
    126 !ifndef %curl_static
    127 OBJS1 += $(CURLX_CFILES:../lib/=)
    128 !endif
    129 OBJS2 = $(OBJS1: = $(OBJ_DIR)/)
    130 OBJS = $(OBJS2:.c=.obj)
    131 
    132 RESOURCE = $(OBJ_DIR)/curl.res
    133 
    134 DIRS = $(OBJ_DIR)
    135 
    136 all: tool_hugehelp.c $(DIRS) $(TARGETS) .SYMBOLIC
    137 	@echo Welcome to cURL
    138 
    139 clean: .SYMBOLIC
    140 	-rm -f $(OBJS)
    141 	-rm -f $(RESOURCE) $(LINK_ARG)
    142 
    143 vclean distclean: clean .SYMBOLIC
    144 	-$(RD) $(OBJ_DIR)
    145 	-rm -f curl.exe curl.sym tool_hugehelp.c
    146 
    147 tool_hugehelp.c: tool_hugehelp.c.cvs
    148 	$(CP) $[@ $^@
    149 
    150 tool_hugehelp.c.cvs: .EXISTSONLY
    151 	$(CP) tool_hugehelp.c $^@
    152 
    153 $(DIRS):
    154 	-$(MD) $^@
    155 
    156 curl.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