1 #########################################################################
4 ## Makefile for building curl.exe with MingW32 (GCC-3.2 or later)
5 ## and optionally OpenSSL (0.9.8), libssh2 (1.1), zlib (1.2.3)
8 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=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 ## Comments to: Troy Engel <tengel@sonic.net> or
15 ## Joern Hartroth <hartroth@acm.org>
16 #########################################################################
18 # Edit the path below to point to the base of your Zlib sources.
20 ZLIB_PATH = ../../zlib-1.2.3
22 # Edit the path below to point to the base of your OpenSSL package.
24 OPENSSL_PATH = ../../openssl-0.9.8k
26 # Edit the path below to point to the base of your LibSSH2 package.
28 LIBSSH2_PATH = ../../libssh2-1.1
30 # Edit the path below to point to the base of your libidn package.
32 LIBIDN_PATH = ../../libidn-1.13
34 # Edit the path below to point to the base of your Novell LDAP NDK.
36 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
43 # comment LDFLAGS below to keep debug info
46 RCFLAGS = --include-dir=../include -O COFF -i
47 RM = del /q /f > NUL 2>&1
50 # We may need these someday
54 ########################################################
55 ## Nothing more to do below this line!
57 INCLUDES = -I. -I.. -I../include -I../lib
58 LINK = $(CC) $(LDFLAGS) -o $@
60 curl_PROGRAMS = curl.exe
62 curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
63 curl_LDADD = -L../lib -lcurldll
65 curl_DEPENDENCIES = ../lib/libcurl.a
66 curl_LDADD = -L../lib -lcurl
67 CFLAGS += -DCURL_STATICLIB
71 curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
74 curl_LDADD += -L$(ARES_LIB) -lcares
77 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
78 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
81 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
82 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
85 INCLUDES += -I"$(ZLIB_PATH)"
86 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
87 curl_LDADD += -L$(ZLIB_PATH) -lz
90 INCLUDES += -I"$(LIBIDN_PATH)/include"
91 CFLAGS += -DUSE_LIBIDN
92 curl_LDADD += -L$(LIBIDN_PATH)/lib -lidn
95 CFLAGS += -DUSE_WINDOWS_SSPI
98 CFLAGS += -DENABLE_IPV6
101 CFLAGS += -DHAVE_LDAP_SSL
103 ifdef USE_LDAP_NOVELL
104 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
105 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
107 ifdef USE_LDAP_OPENLDAP
108 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
109 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
111 ifndef USE_LDAP_NOVELL
112 ifndef USE_LDAP_OPENLDAP
113 curl_LDADD += -lwldap32
116 curl_LDADD += -lws2_32
117 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
119 # Makefile.inc provides the CSOURCES and HHEADERS defines
122 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_SOURCES)))
124 curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
125 curl_OBJECTS += $(curlx_OBJECTS)
135 curl.exe: $(RESOURCE) $(curl_OBJECTS) $(curl_DEPENDENCIES)
137 $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
139 # We don't have nroff normally under win32
140 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
142 # $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
146 @$(CP) hugehelp.c.cvs $@
152 $(RC) $(RCFLAGS) $< -o $@
155 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
158 -$(RM) $(curl_OBJECTS) $(RESOURCE)
161 -$(RM) $(curl_PROGRAMS)