1 #########################################################################
3 ## Makefile for building curl.exe with MingW32 (GCC-3.2 or later)
4 ## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5)
7 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [RTMP=1] [DYN=1]
9 ## Hint: you can also set environment vars to control the build, f.e.:
10 ## set ZLIB_PATH=c:/zlib-1.2.5
13 ## Comments to: Troy Engel <tengel@sonic.net> or
14 ## Joern Hartroth <hartroth@acm.org>
15 #########################################################################
17 # Edit the path below to point to the base of your Zlib sources.
19 ZLIB_PATH = ../../zlib-1.2.5
21 # Edit the path below to point to the base of your OpenSSL package.
23 OPENSSL_PATH = ../../openssl-0.9.8q
25 # Edit the path below to point to the base of your LibSSH2 package.
27 LIBSSH2_PATH = ../../libssh2-1.2.7
29 # Edit the path below to point to the base of your libidn package.
31 LIBIDN_PATH = ../../libidn-1.18
33 # Edit the path below to point to the base of your librtmp package.
35 LIBRTMP_PATH = ../../librtmp-2.3
37 # Edit the path below to point to the base of your Novell LDAP NDK.
39 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
42 # Edit the path below to point to the base of your c-ares package.
44 LIBCARES_PATH = ../ares
49 # comment LDFLAGS below to keep debug info
52 RCFLAGS = --include-dir=../include -O COFF -i
56 # We may need these someday
60 ########################################################
61 ## Nothing more to do below this line!
63 INCLUDES = -I. -I.. -I../include -I../lib
64 LINK = $(CC) $(LDFLAGS) -o $@
66 curl_PROGRAMS = curl.exe
68 curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
69 curl_LDADD = -L../lib -lcurldll
71 curl_DEPENDENCIES = ../lib/libcurl.a
72 curl_LDADD = -L../lib -lcurl
73 CFLAGS += -DCURL_STATICLIB
77 curl_DEPENDENCIES += $(LIBCARES_PATH)/libcares.a
80 curl_LDADD += -L$(LIBCARES_PATH) -lcares
83 CFLAGS += -DUSE_LIBRTMP
84 curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
87 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
88 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
91 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
92 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
95 INCLUDES += -I"$(ZLIB_PATH)"
96 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
97 curl_LDADD += -L$(ZLIB_PATH) -lz
100 INCLUDES += -I"$(LIBIDN_PATH)/include"
101 CFLAGS += -DUSE_LIBIDN
102 curl_LDADD += -L$(LIBIDN_PATH)/lib -lidn
105 CFLAGS += -DUSE_WINDOWS_SSPI
108 CFLAGS += -DENABLE_IPV6
111 CFLAGS += -DHAVE_LDAP_SSL
113 ifdef USE_LDAP_NOVELL
114 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
115 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
117 ifdef USE_LDAP_OPENLDAP
118 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
119 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
121 ifndef USE_LDAP_NOVELL
122 ifndef USE_LDAP_OPENLDAP
123 curl_LDADD += -lwldap32
126 curl_LDADD += -lws2_32
127 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
129 # Makefile.inc provides the CSOURCES and HHEADERS defines
132 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_CFILES)))
134 curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
135 curl_OBJECTS += $(curlx_OBJECTS)
145 curl.exe: $(RESOURCE) $(curl_OBJECTS) $(curl_DEPENDENCIES)
147 $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
149 # We don't have nroff normally under win32
150 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
152 # $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
156 @$(CP) hugehelp.c.cvs $@
162 $(RC) $(RCFLAGS) $< -o $@
165 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
168 -$(RM) $(curl_OBJECTS) $(RESOURCE)
170 distclean vclean: clean
171 -$(RM) $(curl_PROGRAMS)