1 #########################################################################
2 # $Id: Makefile.m32,v 1.1.1.1 2008-09-23 16:32:06 hoffman Exp $
4 ## Makefile for building curl.exe with MingW32 (GCC-3.2)
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 ## 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.8g
26 # Edit the path below to point to the base of your LibSSH2 package.
28 LIBSSH2_PATH = ../../libssh2-0.18
30 # Edit the path below to point to the base of your Novell LDAP NDK.
32 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
39 # comment LDFLAGS below to keep debug info
42 RCFLAGS = --include-dir=../include -O COFF -i
43 RM = del /q /f > NUL 2>&1
46 # We may need these someday
50 ########################################################
51 ## Nothing more to do below this line!
53 INCLUDES = -I. -I.. -I../include -I../lib
54 LINK = $(CC) $(LDFLAGS) -o $@
56 curl_PROGRAMS = curl.exe
58 curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
59 curl_LDADD = -L../lib -lcurldll
61 curl_DEPENDENCIES = ../lib/libcurl.a
62 curl_LDADD = -L../lib -lcurl
63 CFLAGS += -DCURL_STATICLIB
67 curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
70 curl_LDADD += -L$(ARES_LIB) -lcares
73 CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
74 curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
77 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
78 curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
81 INCLUDES += -I"$(ZLIB_PATH)"
82 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
83 curl_LDADD += -L$(ZLIB_PATH) -lz
86 CFLAGS += -DUSE_WINDOWS_SSPI
89 CFLAGS += -DENABLE_IPV6
92 CFLAGS += -DHAVE_LDAP_SSL
95 CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
96 curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
98 ifdef USE_LDAP_OPENLDAP
99 CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
100 curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
102 ifndef USE_LDAP_NOVELL
103 ifndef USE_LDAP_OPENLDAP
104 curl_LDADD += -lwldap32
107 curl_LDADD += -lws2_32
108 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
110 # Makefile.inc provides the CSOURCES and HHEADERS defines
113 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_SOURCES)))
114 # curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
123 curl.exe: $(RESOURCE) $(curl_OBJECTS) $(curl_DEPENDENCIES)
125 $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
127 # We don't have nroff normally under win32
128 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
130 # $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
134 @$(CP) hugehelp.c.cvs $@
140 $(RC) $(RCFLAGS) $< -o $@
143 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
146 -$(RM) $(curl_OBJECTS) $(RESOURCE)
149 -$(RM) $(curl_PROGRAMS)