1 #########################################################################
2 # $Id: Makefile.m32,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
4 ## Makefile for building curl examples with MingW32
5 ## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3)
8 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1]
10 ## Hint: you can also set environment vars to control the build, f.e.:
11 ## set ZLIB_PATH=c:/zlib-1.2.3
14 #########################################################################
16 # Edit the path below to point to the base of your Zlib sources.
18 ZLIB_PATH = ../../zlib-1.2.3
20 # Edit the path below to point to the base of your OpenSSL package.
22 OPENSSL_PATH = ../../openssl-0.9.8g
24 # Edit the path below to point to the base of your LibSSH2 package.
26 LIBSSH2_PATH = ../../libssh2-0.18
28 # Edit the path below to point to the base of your Novell LDAP NDK.
30 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
34 ARES_LIB = $(PROOT)/ares
41 # comment LDFLAGS below to keep debug info
44 RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
45 RM = del /q /f > NUL 2>&1
48 ########################################################
49 ## Nothing more to do below this line!
51 INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
52 LINK = $(CC) $(LDFLAGS) -o $@
55 curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
56 curl_LDADD = -L$(PROOT)/lib -lcurldll
58 curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a
59 curl_LDADD = -L$(PROOT)/lib -lcurl
60 CFLAGS += -DCURL_STATICLIB
64 curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
67 curl_LDADD += -L$(ARES_LIB) -lcares
70 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
71 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
74 INCLUDES += -I"$(OPENSSL_PATH)/outinc"
75 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
77 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
79 curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
83 INCLUDES += -I"$(ZLIB_PATH)"
84 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
85 curl_LDADD += -L$(ZLIB_PATH) -lz
88 CFLAGS += -DUSE_WINDOWS_SSPI
91 CFLAGS += -DENABLE_IPV6
94 CFLAGS += -DHAVE_LDAP_SSL
97 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
98 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
100 ifdef USE_LDAP_OPENLDAP
101 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
102 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
104 ifndef USE_LDAP_NOVELL
105 ifndef USE_LDAP_OPENLDAP
106 curl_LDADD += -lwldap32
109 curl_LDADD += -lws2_32
110 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
112 # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
115 example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
117 .SUFFIXES: .rc .res .o .exe
120 all: $(example_PROGRAMS)
122 .o.exe: $(curl_DEPENDENCIES)
123 $(LINK) $< $(curl_LDADD)
129 $(RC) $(RCFLAGS) $< -o $@
132 $(RM) $(example_PROGRAMS)