Makefile.m32 3.2 KB

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