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] [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.8o
25 # Edit the path below to point to the base of your LibSSH2 package.
27 LIBSSH2_PATH = ../../libssh2-1.2.6
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 Novell LDAP NDK.
35 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
38 # Edit the path below to point to the base of your c-ares package.
40 LIBCARES_PATH = ../ares
45 # comment LDFLAGS below to keep debug info
48 RCFLAGS = --include-dir=../include -O COFF -i
49 RM = del /q /f > NUL 2>&1
52 # We may need these someday
56 ########################################################
57 ## Nothing more to do below this line!
59 INCLUDES = -I. -I.. -I../include -I../lib
60 LINK = $(CC) $(LDFLAGS) -o $@
62 curl_PROGRAMS = curl.exe
64 curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
65 curl_LDADD = -L../lib -lcurldll
67 curl_DEPENDENCIES = ../lib/libcurl.a
68 curl_LDADD = -L../lib -lcurl
69 CFLAGS += -DCURL_STATICLIB
73 curl_DEPENDENCIES += $(LIBCARES_PATH)/libcares.a
76 curl_LDADD += -L$(LIBCARES_PATH) -lcares
79 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
80 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
83 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
84 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
87 INCLUDES += -I"$(ZLIB_PATH)"
88 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
89 curl_LDADD += -L$(ZLIB_PATH) -lz
92 INCLUDES += -I"$(LIBIDN_PATH)/include"
93 CFLAGS += -DUSE_LIBIDN
94 curl_LDADD += -L$(LIBIDN_PATH)/lib -lidn
97 CFLAGS += -DUSE_WINDOWS_SSPI
100 CFLAGS += -DENABLE_IPV6
103 CFLAGS += -DHAVE_LDAP_SSL
105 ifdef USE_LDAP_NOVELL
106 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
107 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
109 ifdef USE_LDAP_OPENLDAP
110 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
111 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
113 ifndef USE_LDAP_NOVELL
114 ifndef USE_LDAP_OPENLDAP
115 curl_LDADD += -lwldap32
118 curl_LDADD += -lws2_32
119 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
121 # Makefile.inc provides the CSOURCES and HHEADERS defines
124 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_CFILES)))
126 curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
127 curl_OBJECTS += $(curlx_OBJECTS)
137 curl.exe: $(RESOURCE) $(curl_OBJECTS) $(curl_DEPENDENCIES)
139 $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
141 # We don't have nroff normally under win32
142 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
144 # $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
148 @$(CP) hugehelp.c.cvs $@
154 $(RC) $(RCFLAGS) $< -o $@
157 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
160 -$(RM) $(curl_OBJECTS) $(RESOURCE)
163 -$(RM) $(curl_PROGRAMS)