etlegacy-libs/curl/lib/Makefile.Watcom

276 lines
6.5 KiB
Text
Raw Normal View History

2016-09-16 04:29:17 +00:00
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2005 - 2009, Gisle Vanem <gvanem@yahoo.no>.
2018-02-04 17:52:34 +00:00
# Copyright (C) 2005 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
2016-09-16 04:29:17 +00:00
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
#***************************************************************************
2012-06-01 15:23:17 +00:00
#
# Watcom / OpenWatcom / Win32 makefile for libcurl.
#
2016-09-16 04:29:17 +00:00
.ERASE
!if $(__VERSION__) < 1280
!message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!message ! This Open Watcom version is too old and is no longer supported !
!message ! Please download latest version from www.openwatcom.org !
!message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!error Unsupported version of Open Watcom
!endif
2012-06-01 15:23:17 +00:00
!ifndef %watcom
!error WATCOM environment variable not set!
!endif
2016-09-16 04:29:17 +00:00
# In order to process Makefile.inc wmake must be called with -u switch!
!ifndef %MAKEFLAGS
!error You MUST call wmake with the -u switch!
!endif
2012-06-01 15:23:17 +00:00
!ifdef %libname
LIBNAME = $(%libname)
!else
LIBNAME = libcurl
!endif
2016-09-16 04:29:17 +00:00
TARGETS = $(LIBNAME).dll $(LIBNAME).lib
2012-06-01 15:23:17 +00:00
CC = wcc386
LD = wlink
AR = wlib
RC = wrc
!ifdef __LOADDLL__
! loaddll wcc386 wccd386
! loaddll wpp386 wppd386
! loaddll wlib wlibd
2016-09-16 04:29:17 +00:00
! loaddll wlink wlinkd
2012-06-01 15:23:17 +00:00
!endif
!ifdef __LINUX__
CP = cp
MD = mkdir -p
!else
CP = copy 2>NUL
MD = mkdir
!endif
2016-09-16 04:29:17 +00:00
!if $(__VERSION__) > 1290
RD = rm -rf
!else ifdef __UNIX__
RD = rm -rf
!else
RD = rmdir /q /s 2>NUL
2012-06-01 15:23:17 +00:00
!endif
2016-09-16 04:29:17 +00:00
SYS_INCL = -I"$(%watcom)/h/nt" -I"$(%watcom)/h"
2012-06-01 15:23:17 +00:00
CFLAGS = -3r -mf -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm &
2018-02-04 17:52:34 +00:00
-wcd=201 -bt=nt -d+ -dWIN32 &
2016-09-16 04:29:17 +00:00
-dBUILDING_LIBCURL -I. -I"../include" $(SYS_INCL)
2012-06-01 15:23:17 +00:00
!ifdef %debug
DEBUG = -dDEBUG=1 -dDEBUGBUILD
CFLAGS += -d3 $(DEBUG)
!else
CFLAGS += -d0
!endif
!ifdef %use_ipv6
CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
!endif
!ifdef %use_sspi
CFLAGS += -dUSE_WINDOWS_SSPI
!endif
2016-09-16 04:29:17 +00:00
!ifdef %use_winssl
CFLAGS += -dUSE_WINDOWS_SSPI
CFLAGS += -DUSE_SCHANNEL
!endif
2012-06-01 15:23:17 +00:00
!ifdef %use_winidn
CFLAGS += -dWINVER=0x0600 -dUSE_WIN32_IDN
! if $(__VERSION__) <= 1290
CFLAGS += -dWANT_IDN_PROTOTYPES
! endif
!endif
#
# Change to suite.
#
!ifdef %zlib_root
ZLIB_ROOT = $(%zlib_root)
!else
2016-09-16 04:29:17 +00:00
ZLIB_ROOT = ../../zlib-1.2.8
2012-06-01 15:23:17 +00:00
!endif
!ifdef %libssh2_root
LIBSSH2_ROOT = $(%libssh2_root)
!else
2016-09-16 04:29:17 +00:00
LIBSSH2_ROOT = ../../libssh2-1.5.0
2012-06-01 15:23:17 +00:00
!endif
!ifdef %librtmp_root
LIBRTMP_ROOT = $(%librtmp_root)
!else
2016-09-16 04:29:17 +00:00
LIBRTMP_ROOT = ../../rtmpdump-2.3
2012-06-01 15:23:17 +00:00
!endif
!ifdef %openssl_root
OPENSSL_ROOT = $(%openssl_root)
!else
2016-09-16 04:29:17 +00:00
OPENSSL_ROOT = ../../openssl-1.0.2a
2012-06-01 15:23:17 +00:00
!endif
!ifdef %ares_root
ARES_ROOT = $(%ares_root)
!else
2016-09-16 04:29:17 +00:00
ARES_ROOT = ../ares
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_zlib
2016-09-16 04:29:17 +00:00
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I"$(ZLIB_ROOT)"
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_rtmp
2016-09-16 04:29:17 +00:00
CFLAGS += -dUSE_LIBRTMP -I"$(LIBRTMP_ROOT)"
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ssh2
2016-09-16 04:29:17 +00:00
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H -I"$(LIBSSH2_ROOT)/include" -I"$(LIBSSH2_ROOT)/win32"
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ssl
2016-09-16 04:29:17 +00:00
CFLAGS += -wcd=138 -dUSE_OPENSSL -dUSE_SSLEAY -I"$(OPENSSL_ROOT)/inc32"
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ares
2016-09-16 04:29:17 +00:00
CFLAGS += -dUSE_ARES -I"$(ARES_ROOT)"
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_watt32
2016-09-16 04:29:17 +00:00
CFLAGS += -dUSE_WATT32 -I"$(%watt_root)/inc"
2012-06-01 15:23:17 +00:00
!endif
OBJ_BASE = WC_Win32.obj
2016-09-16 04:29:17 +00:00
!if $(__VERSION__) > 1290
OBJ_STAT = $(OBJ_BASE)/stat
OBJ_DYN = $(OBJ_BASE)/dyn
!else ifdef __UNIX__
OBJ_STAT = $(OBJ_BASE)/stat
OBJ_DYN = $(OBJ_BASE)/dyn
2012-06-01 15:23:17 +00:00
!else
2016-09-16 04:29:17 +00:00
OBJ_STAT = $(OBJ_BASE)\stat
OBJ_DYN = $(OBJ_BASE)\dyn
2012-06-01 15:23:17 +00:00
!endif
2016-09-16 04:29:17 +00:00
LINK_ARG = $(OBJ_DYN)/wlink.arg
LIB_ARG = $(OBJ_STAT)/wlib.arg
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
!include Makefile.inc
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
OBJS1 = ./$(CSOURCES:.c=.obj)
OBJS2 = $(OBJS1:vtls/=)
OBJS3 = $(OBJS2:vauth/=)
OBJS4 = $(OBJS3: = ./)
OBJS_STAT = $(OBJS4:./=$(OBJ_STAT)/)
OBJS_DYN = $(OBJS4:./=$(OBJ_DYN)/)
RESOURCE = $(OBJ_DYN)/libcurl.res
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
DIRS = $(OBJ_BASE) $(OBJ_BASE)/stat $(OBJ_BASE)/dyn
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
.c : vauth vtls
2015-01-23 15:30:59 +00:00
2018-02-04 17:52:34 +00:00
all: $(DIRS) $(TARGETS) .SYMBOLIC
2012-06-01 15:23:17 +00:00
@echo Welcome to libcurl
clean: .SYMBOLIC
2016-09-16 04:29:17 +00:00
-rm -f $(OBJS_STAT)
-rm -f $(OBJS_DYN)
-rm -f $(RESOURCE) $(LINK_ARG) $(LIB_ARG)
2012-06-01 15:23:17 +00:00
vclean distclean: clean .SYMBOLIC
2016-09-16 04:29:17 +00:00
-rm -f $(TARGETS) $(LIBNAME).map $(LIBNAME).sym
-$(RD) $(OBJ_STAT)
-$(RD) $(OBJ_DYN)
2012-06-01 15:23:17 +00:00
-$(RD) $(OBJ_BASE)
2016-09-16 04:29:17 +00:00
$(DIRS):
2012-06-01 15:23:17 +00:00
-$(MD) $^@
2016-09-16 04:29:17 +00:00
$(LIBNAME).dll: $(OBJS_DYN) $(RESOURCE) $(__MAKEFILES__)
%create $(LINK_ARG)
@%append $(LINK_ARG) system nt dll
2012-06-01 15:23:17 +00:00
!ifdef %debug
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) debug all
@%append $(LINK_ARG) option symfile
2012-06-01 15:23:17 +00:00
!endif
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) option quiet, caseexact, eliminate
@%append $(LINK_ARG) option map=$(OBJ_DYN)/$(LIBNAME).map
@%append $(LINK_ARG) option implib=$(LIBNAME)_imp.lib
@%append $(LINK_ARG) option res=$(RESOURCE)
@for %f in ($(OBJS_DYN)) do @%append $(LINK_ARG) file %f
@%append $(LINK_ARG) library wldap32.lib
2012-06-01 15:23:17 +00:00
!ifdef %use_watt32
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(%watt_root)/lib/wattcpw_imp.lib'
2012-06-01 15:23:17 +00:00
!else
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library ws2_32.lib
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_zlib
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(ZLIB_ROOT)/zlib.lib'
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_rtmp
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(LIBRTMP_ROOT)/librtmp/librtmp.lib'
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ssh2
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(LIBSSH2_ROOT)/win32/libssh2.lib'
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ssl
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/libeay32.lib'
@%append $(LINK_ARG) library '$(OPENSSL_ROOT)/out32/ssleay32.lib'
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_ares
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library '$(ARES_ROOT)/cares.lib'
2012-06-01 15:23:17 +00:00
!endif
!ifdef %use_winidn
! if $(__VERSION__) > 1290
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) library normaliz.lib
2012-06-01 15:23:17 +00:00
! else
2016-09-16 04:29:17 +00:00
@%append $(LINK_ARG) import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
@%append $(LINK_ARG) import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
2012-06-01 15:23:17 +00:00
! endif
!endif
2016-09-16 04:29:17 +00:00
$(LD) name $^@ @$(LINK_ARG)
$(LIBNAME).lib: $(OBJS_STAT)
%create $(LIB_ARG)
@for %f in ($<) do @%append $(LIB_ARG) +- %f
$(AR) -q -b -c -pa $^@ @$(LIB_ARG)
$(RESOURCE): libcurl.rc
$(RC) $(DEBUG) -q -r -zm -bt=nt -I"../include" $(SYS_INCL) $[@ -fo=$^@
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
.c{$(OBJ_DYN)}.obj:
$(CC) $(CFLAGS) -bd -br $[@ -fo=$^@
2012-06-01 15:23:17 +00:00
2016-09-16 04:29:17 +00:00
.c{$(OBJ_STAT)}.obj:
$(CC) $(CFLAGS) -DCURL_STATICLIB $[@ -fo=$^@