1 #############################################################
3 ## Makefile for building libcurl.a with MingW32 (GCC-3.2) and
4 ## optionally OpenSSL (0.9.7)
5 ## Use: make -f Makefile.m32
7 ## Comments to: Troy Engel <tengel@sonic.net> or
8 ## Joern Hartroth <hartroth@acm.org>
15 OPENSSL_PATH = ../../openssl-0.9.7c
16 ZLIB_PATH = ../../zlib-1.2.1
18 ########################################################
19 ## Nothing more to do below this line!
21 INCLUDES = -I. -I.. -I../include -I../src
22 CFLAGS = -g -O2 -DMINGW32
24 INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl"
25 CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
26 DLL_LIBS = -L$(OPENSSL_PATH)/out -leay32 -lssl32
29 INCLUDES += -I"$(ZLIB_PATH)"
30 CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
31 DLL_LIBS += -L$(ZLIB_PATH) -lz
33 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
35 libcurl_a_LIBRARIES = libcurl.a
37 libcurl_a_SOURCES = arpa_telnet.h file.c netrc.h timeval.c base64.c \
38 file.h hostip.c progress.c timeval.h base64.h formdata.c hostip.h \
39 progress.h cookie.c formdata.h http.c sendf.c cookie.h ftp.c \
40 http.h sendf.h url.c dict.c ftp.h if2ip.c speedcheck.c url.h \
41 dict.h getdate.c if2ip.h speedcheck.h urldata.h transfer.c getdate.h \
42 ldap.c ssluse.c version.c transfer.h getenv.c \
43 ldap.h ssluse.h escape.c getenv.h mprintf.c telnet.c escape.h \
44 netrc.c telnet.h getinfo.c strequal.c strequal.h easy.c \
45 security.h security.c krb4.h krb4.c memdebug.h memdebug.c \
46 inet_ntoa_r.h http_chunks.h http_chunks.c \
47 strtok.c connect.c hash.c llist.c multi.c share.c share.h \
48 content_encoding.h content_encoding.c http_digest.h http_digest.c \
49 http_negotiate.c http_negotiate.h http_ntlm.c http_ntlm.h md5.h \
50 md5.c strtoofft.c inet_pton.c
52 libcurl_a_OBJECTS = file.o timeval.o base64.o hostip.o progress.o \
53 formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o \
54 speedcheck.o getdate.o transfer.o ldap.o ssluse.o version.o \
55 getenv.o escape.o mprintf.o telnet.o netrc.o getinfo.o \
56 strequal.o easy.o security.o krb4.o memdebug.o http_chunks.o \
57 strtok.o connect.o hash.o llist.o multi.o share.o \
58 content_encoding.o http_digest.o http_negotiate.o http_ntlm.o md5.o \
59 strtoofft.o inet_pton.o
61 LIBRARIES = $(libcurl_a_LIBRARIES)
62 SOURCES = $(libcurl_a_SOURCES)
63 OBJECTS = $(libcurl_a_OBJECTS)
66 all: libcurl.a libcurl.dll libcurldll.a
68 libcurl.a: $(libcurl_a_OBJECTS) $(libcurl_a_DEPENDENCIES)
70 $(AR) cru libcurl.a $(libcurl_a_OBJECTS)
74 RESOURCE = libcurl.res
76 # remove the last line above to keep debug info
78 libcurl.dll libcurldll.a: libcurl.a libcurl.def $(RESOURCE)
80 dllwrap --dllname $@ --output-lib libcurldll.a --export-all --def libcurl.def $(libcurl_a_LIBRARIES) $(RESOURCE) $(DLL_LIBS) -lwsock32 -lws2_32 -lwinmm
83 # remove the last line above to keep debug info
94 libcurl.res: libcurl.rc
95 windres -DCURLDEBUG=0 -O COFF -o $@ -i $^
98 $(RM) $(libcurl_a_OBJECTS) $(RESOURCE)
101 $(RM) $(libcurl_a_LIBRARIES)