changed to use Makefile.inc; made paths overwritable.
[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.7)
6 ##
7 ## Use: make -f Makefile.m32 [SSL=1] [DYN=1]
8 ##
9 ## Comments to: Troy Engel <tengel@sonic.net> or
10 ##              Joern Hartroth <hartroth@acm.org>
11
12 ifndef OPENSSL_PATH
13 OPENSSL_PATH = ../../openssl-0.9.7d
14 endif
15 ifndef ZLIB_PATH
16 ZLIB_PATH = ../../zlib-1.2.1
17 endif
18
19 CC = gcc
20 RM = rm -f
21 STRIP = strip -s
22
23 # We may need these someday
24 # PERL = perl
25 # NROFF = nroff
26
27 ########################################################
28 ## Nothing more to do below this line!
29
30 INCLUDES = -I. -I.. -I../include -I../lib -I$(ZLIB_PATH)
31 CFLAGS = -g -O2 -DMINGW32
32 ifdef SSL
33   CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
34 endif
35 LDFLAGS = 
36 COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
37 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
38
39 curl_PROGRAMS = curl.exe
40 ifdef DYN
41   curl_DEPENDENCIES = ../lib/libcurldll.a ../lib/libcurl.dll
42   curl_LDADD = -L../lib -lcurldll
43 else
44   curl_DEPENDENCIES = ../lib/libcurl.a
45   curl_LDADD = -L../lib -lcurl
46 endif
47 curl_LDADD += -lwsock32 -lws2_32 -lwinmm -L$(ZLIB_PATH) -lz
48 ifdef SSL
49   curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
50 endif
51
52 # Makefile.inc provides the CSOURCES and HHEADERS defines
53 include Makefile.inc
54
55 curl_OBJECTS := $(patsubst %.c,%.o,$(strip $(CURL_SOURCES)))
56 # curlx_OBJECTS := $(patsubst %.c,%.o,$(notdir $(strip $(CURLX_ONES))))
57 # vpath %.c ../lib
58
59
60 all: curl.exe
61
62 curl.exe: $(curl_OBJECTS) $(curl_DEPENDENCIES)
63         $(RM) $@
64         $(LINK) $(curl_OBJECTS) $(curl_LDADD)
65         $(STRIP) $@
66
67 # We don't have nroff normally under win32
68 # hugehelp.c: ../README.curl ../curl.1 mkhelp.pl
69 #       $(RM) hugehelp.c
70 #       $(NROFF) -man ../curl.1 | $(PERL) mkhelp.pl ../README.curl > hugehelp.c
71
72 .c.o:
73         $(COMPILE) -c $<
74
75 .s.o:
76         $(COMPILE) -c $<
77
78 .S.o:
79         $(COMPILE) -c $<
80
81 clean:
82         $(RM) $(curl_OBJECTS) curl.exe
83
84 distrib: clean
85         $(RM) $(curl_PROGRAMS)