1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 ###########################################################################
22 #########################################################################
24 ## Makefile for building curl examples with MingW32
25 ## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3)
28 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1]
30 ## Hint: you can also set environment vars to control the build, f.e.:
31 ## set ZLIB_PATH=c:/zlib-1.2.3
34 #########################################################################
36 # Edit the path below to point to the base of your Zlib sources.
38 ZLIB_PATH = ../../zlib-1.2.3
40 # Edit the path below to point to the base of your OpenSSL package.
42 OPENSSL_PATH = ../../openssl-0.9.8k
44 # Edit the path below to point to the base of your LibSSH2 package.
46 LIBSSH2_PATH = ../../libssh2-1.2
48 # Edit the path below to point to the base of your Novell LDAP NDK.
50 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
54 ARES_LIB = $(PROOT)/ares
61 # comment LDFLAGS below to keep debug info
64 RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
65 RM = del /q /f > NUL 2>&1
68 ########################################################
69 ## Nothing more to do below this line!
71 INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
72 LINK = $(CC) $(LDFLAGS) -o $@
75 curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
76 curl_LDADD = -L$(PROOT)/lib -lcurldll
78 curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a
79 curl_LDADD = -L$(PROOT)/lib -lcurl
80 CFLAGS += -DCURL_STATICLIB
84 curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
87 curl_LDADD += -L$(ARES_LIB) -lcares
90 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
91 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
94 INCLUDES += -I"$(OPENSSL_PATH)/outinc"
95 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
97 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
99 curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
103 INCLUDES += -I"$(ZLIB_PATH)"
104 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
105 curl_LDADD += -L$(ZLIB_PATH) -lz
108 CFLAGS += -DUSE_WINDOWS_SSPI
111 CFLAGS += -DENABLE_IPV6
114 CFLAGS += -DHAVE_LDAP_SSL
116 ifdef USE_LDAP_NOVELL
117 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
118 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
120 ifdef USE_LDAP_OPENLDAP
121 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
122 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
124 ifndef USE_LDAP_NOVELL
125 ifndef USE_LDAP_OPENLDAP
126 curl_LDADD += -lwldap32
129 curl_LDADD += -lws2_32
130 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
132 # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
135 example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
137 .SUFFIXES: .rc .res .o .exe
140 all: $(example_PROGRAMS)
142 .o.exe: $(curl_DEPENDENCIES)
143 $(LINK) $< $(curl_LDADD)
149 $(RC) $(RCFLAGS) $< -o $@
152 $(RM) $(example_PROGRAMS)