added targets to create the files missing in CVS which makes calling buildconf.bat...
[platform/upstream/curl.git] / src / Makefile.m32
1 #########################################################################
2 # $Id$
3 #
4 ## Makefile for building curl.exe with MingW32 (GCC-3.2) and
5 ## optionally OpenSSL (0.9.8), libssh2 (0.17), zlib (1.2.3)
6 ##
7 ## Usage:
8 ## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=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.8e
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.16
29 endif
30 # Edit the path below to point to the base of your Novell LDAP NDK.
31 ifndef LDAP_SDK
32 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
33 endif
34
35 ARES_LIB = ../ares
36
37 CC = gcc
38 CFLAGS = -g -O2
39 # comment LDFLAGS below to keep debug info
40 LDFLAGS = -s
41 RC = windres
42 RCFLAGS = --include-dir=../include -O COFF -i
43 RM = del /q /f
44 CP = copy
45
46 # We may need these someday
47 # PERL = perl
48 # NROFF = nroff
49
50 ########################################################
51 ## Nothing more to do below this line!
52
53 INCLUDES = -I. -I.. -I../include -I../lib
54 LINK = $(CC) $(LDFLAGS) -o $@
55
56 curl_PROGRAMS = curl.exe
57 ifdef DYN
58   curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
59   curl_LDADD = -L../lib -lcurldll
60 else
61   curl_DEPENDENCIES = ../lib/libcurl.a
62   curl_LDADD = -L../lib -lcurl
63   CFLAGS += -DCURL_STATICLIB
64 endif
65 ifdef ARES
66   ifndef DYN
67     curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
68   endif
69   CFLAGS += -DUSE_ARES
70   curl_LDADD += -L$(ARES_LIB) -lcares
71 endif
72 ifdef SSH2
73   CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
74   curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
75 endif
76 ifdef SSL
77   CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
78   curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
79 endif
80 ifdef ZLIB
81   INCLUDES += -I"$(ZLIB_PATH)"
82   CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
83   curl_LDADD += -L$(ZLIB_PATH) -lz
84 endif
85 ifdef SSPI
86   CFLAGS += -DUSE_WINDOWS_SSPI
87 endif
88 ifdef IPV6
89   CFLAGS += -DENABLE_IPV6
90 endif
91 ifdef LDAPS
92   CFLAGS += -DHAVE_LDAP_SSL
93   ifdef USE_LDAP_NOVELL
94     # INCLUDES += -I"$(LDAP_SDK)/inc"
95     CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
96     curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
97   endif
98 endif
99 curl_LDADD += -lws2_32 -lwinmm -lwldap32
100 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
101
102 # Makefile.inc provides the CSOURCES and HHEADERS defines
103 include Makefile.inc
104
105 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_SOURCES)))
106 # curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
107 # vpath %.c ../lib
108
109 .SUFFIXES: .rc .res
110
111 all: curl.exe
112
113 curl.exe: curl.res $(curl_OBJECTS) $(curl_DEPENDENCIES)
114         -$(RM) $@
115         $(LINK) $< $(curl_OBJECTS) $(curl_LDADD)
116
117 # We don't have nroff normally under win32
118 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
119 #       -$(RM) hugehelp.c
120 #       $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
121
122 hugehelp.c:
123         @echo Creating $@
124         @$(CP) hugehelp.c.cvs $@
125
126 .c.o:
127         $(COMPILE) -c $<
128
129 .rc.res:
130         $(RC) $(RCFLAGS) $< -o $@
131
132 clean:
133 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
134         -$(RM) hugehelp.c
135 endif
136         -$(RM) $(curl_OBJECTS)
137
138 distrib: clean
139         -$(RM) $(curl_PROGRAMS)
140
141