sourcemod/extensions/curl/curl-src/docs/examples/Makefile.m32

135 lines
3.2 KiB
Makefile
Raw Normal View History

2013-03-18 01:55:59 +01:00
#########################################################################
# $Id: Makefile.m32,v 1.4 2008-05-09 16:31:51 yangtse Exp $
2009-01-09 00:31:00 +01:00
#
2013-03-18 01:55:59 +01:00
## Makefile for building curl examples with MingW32
## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3)
2009-01-09 00:31:00 +01:00
##
2013-03-18 01:55:59 +01:00
## Usage:
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1]
2009-01-09 00:31:00 +01:00
##
## Hint: you can also set environment vars to control the build, f.e.:
2013-03-18 01:55:59 +01:00
## set ZLIB_PATH=c:/zlib-1.2.3
2009-01-09 00:31:00 +01:00
## set ZLIB=1
2013-03-18 01:55:59 +01:00
##
#########################################################################
2009-01-09 00:31:00 +01:00
# Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH
2013-03-18 01:55:59 +01:00
ZLIB_PATH = ../../zlib-1.2.3
2009-01-09 00:31:00 +01:00
endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
2013-03-18 01:55:59 +01:00
OPENSSL_PATH = ../../openssl-0.9.8g
2009-01-09 00:31:00 +01:00
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
2013-03-18 01:55:59 +01:00
LIBSSH2_PATH = ../../libssh2-0.18
2009-01-09 00:31:00 +01:00
endif
# Edit the path below to point to the base of your Novell LDAP NDK.
ifndef LDAP_SDK
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
endif
PROOT = ../..
2013-03-18 01:55:59 +01:00
ARES_LIB = $(PROOT)/ares
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
SSL = 1
ZLIB = 1
2013-03-17 23:23:20 +01:00
2013-03-18 01:55:59 +01:00
CC = gcc
CFLAGS = -g -O2 -Wall
2009-01-09 00:31:00 +01:00
# comment LDFLAGS below to keep debug info
2013-03-18 01:55:59 +01:00
LDFLAGS = -s
RC = windres
RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
RM = del /q /f > NUL 2>&1
CP = copy
2009-01-09 00:31:00 +01:00
########################################################
## Nothing more to do below this line!
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
2013-03-18 01:55:59 +01:00
LINK = $(CC) $(LDFLAGS) -o $@
2009-01-09 00:31:00 +01:00
ifdef DYN
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
curl_LDADD = -L$(PROOT)/lib -lcurldll
else
curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a
curl_LDADD = -L$(PROOT)/lib -lcurl
CFLAGS += -DCURL_STATICLIB
endif
ifdef ARES
ifndef DYN
2013-03-18 01:55:59 +01:00
curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
2009-01-09 00:31:00 +01:00
endif
CFLAGS += -DUSE_ARES
2013-03-18 01:55:59 +01:00
curl_LDADD += -L$(ARES_LIB) -lcares
2009-01-09 00:31:00 +01:00
endif
ifdef SSH2
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
2013-03-18 01:55:59 +01:00
curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
2009-01-09 00:31:00 +01:00
endif
ifdef SSL
2013-03-18 01:55:59 +01:00
INCLUDES += -I"$(OPENSSL_PATH)/outinc"
CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
ifdef DYN
curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
else
curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
2009-01-09 00:31:00 +01:00
endif
endif
ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)"
CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
2013-03-18 01:55:59 +01:00
curl_LDADD += -L$(ZLIB_PATH) -lz
2009-01-09 00:31:00 +01:00
endif
ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI
endif
ifdef IPV6
2013-03-18 01:55:59 +01:00
CFLAGS += -DENABLE_IPV6
2009-01-09 00:31:00 +01:00
endif
ifdef LDAPS
CFLAGS += -DHAVE_LDAP_SSL
endif
ifdef USE_LDAP_NOVELL
CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
endif
ifdef USE_LDAP_OPENLDAP
CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
endif
ifndef USE_LDAP_NOVELL
ifndef USE_LDAP_OPENLDAP
2013-03-18 01:55:59 +01:00
curl_LDADD += -lwldap32
2009-01-09 00:31:00 +01:00
endif
endif
curl_LDADD += -lws2_32
2013-03-18 01:55:59 +01:00
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
2009-01-09 00:31:00 +01:00
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
include Makefile.inc
2013-03-18 01:55:59 +01:00
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
.SUFFIXES: .rc .res .o .exe
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
all: $(example_PROGRAMS)
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
.o.exe: $(curl_DEPENDENCIES)
$(LINK) $< $(curl_LDADD)
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
.c.o:
$(COMPILE) -c $<
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
.rc.res:
2009-01-09 00:31:00 +01:00
$(RC) $(RCFLAGS) $< -o $@
clean:
2013-03-18 01:55:59 +01:00
$(RM) $(example_PROGRAMS)
2009-01-09 00:31:00 +01:00