changed to latest libidn version.
[platform/upstream/curl.git] / src / Makefile.m32
1 #########################################################################
2 # $Id$
3 #
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)
6 ##
7 ## Usage:
8 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [DYN=1]
9 ##
10 ## Hint: you can also set environment vars to control the build, f.e.:
11 ## set ZLIB_PATH=c:/zlib-1.2.3
12 ## set ZLIB=1
13 ##
14 ## Comments to: Troy Engel <tengel@sonic.net> or
15 ##              Joern Hartroth <hartroth@acm.org>
16 #########################################################################
17
18 # Edit the path below to point to the base of your Zlib sources.
19 ifndef ZLIB_PATH
20 ZLIB_PATH = ../../zlib-1.2.3
21 endif
22 # Edit the path below to point to the base of your OpenSSL package.
23 ifndef OPENSSL_PATH
24 OPENSSL_PATH = ../../openssl-0.9.8i
25 endif
26 # Edit the path below to point to the base of your LibSSH2 package.
27 ifndef LIBSSH2_PATH
28 LIBSSH2_PATH = ../../libssh2-0.18
29 endif
30 # Edit the path below to point to the base of your libidn package.
31 ifndef LIBIDN_PATH
32 LIBIDN_PATH = ../../libidn-1.11
33 endif
34 # Edit the path below to point to the base of your Novell LDAP NDK.
35 ifndef LDAP_SDK
36 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
37 endif
38
39 ARES_LIB = ../ares
40
41 CC = gcc
42 CFLAGS = -g -O2
43 # comment LDFLAGS below to keep debug info
44 LDFLAGS = -s
45 RC = windres
46 RCFLAGS = --include-dir=../include -O COFF -i
47 RM = del /q /f > NUL 2>&1
48 CP = copy
49
50 # We may need these someday
51 # PERL = perl
52 # NROFF = nroff
53
54 ########################################################
55 ## Nothing more to do below this line!
56
57 INCLUDES = -I. -I.. -I../include -I../lib
58 LINK = $(CC) $(LDFLAGS) -o $@
59
60 curl_PROGRAMS = curl.exe
61 ifdef DYN
62   curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
63   curl_LDADD = -L../lib -lcurldll
64 else
65   curl_DEPENDENCIES = ../lib/libcurl.a
66   curl_LDADD = -L../lib -lcurl
67   CFLAGS += -DCURL_STATICLIB
68 endif
69 ifdef ARES
70   ifndef DYN
71     curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
72   endif
73   CFLAGS += -DUSE_ARES
74   curl_LDADD += -L$(ARES_LIB) -lcares
75 endif
76 ifdef SSH2
77   CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
78   curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
79 endif
80 ifdef SSL
81   CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
82   curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
83 endif
84 ifdef ZLIB
85   INCLUDES += -I"$(ZLIB_PATH)"
86   CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
87   curl_LDADD += -L$(ZLIB_PATH) -lz
88 endif
89 ifdef IDN
90   INCLUDES += -I"$(LIBIDN_PATH)/include"
91   CFLAGS += -DUSE_LIBIDN
92   curl_LDADD += -L$(LIBIDN_PATH)/lib -lidn
93 endif
94 ifdef SSPI
95   CFLAGS += -DUSE_WINDOWS_SSPI
96 endif
97 ifdef IPV6
98   CFLAGS += -DENABLE_IPV6
99 endif
100 ifdef LDAPS
101   CFLAGS += -DHAVE_LDAP_SSL
102 endif
103 ifdef USE_LDAP_NOVELL
104   CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
105   curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
106 endif
107 ifdef USE_LDAP_OPENLDAP
108   CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
109   curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
110 endif
111 ifndef USE_LDAP_NOVELL
112 ifndef USE_LDAP_OPENLDAP
113 curl_LDADD += -lwldap32
114 endif
115 endif
116 curl_LDADD += -lws2_32
117 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
118
119 # Makefile.inc provides the CSOURCES and HHEADERS defines
120 include Makefile.inc
121
122 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_SOURCES)))
123 # curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
124 # vpath %.c ../lib
125
126 RESOURCE = curl.res
127
128 .SUFFIXES: .rc .res
129
130 all: curl.exe
131
132 curl.exe: $(RESOURCE) $(curl_OBJECTS) $(curl_DEPENDENCIES)
133         -$(RM) $@
134         $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
135
136 # We don't have nroff normally under win32
137 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
138 #       -$(RM) hugehelp.c
139 #       $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
140
141 hugehelp.c:
142         @echo Creating $@
143         @$(CP) hugehelp.c.cvs $@
144
145 .c.o:
146         $(COMPILE) -c $<
147
148 .rc.res:
149         $(RC) $(RCFLAGS) $< -o $@
150
151 clean:
152 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
153         -$(RM) hugehelp.c
154 endif
155         -$(RM) $(curl_OBJECTS) $(RESOURCE)
156
157 distrib: clean
158         -$(RM) $(curl_PROGRAMS)
159
160