~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to docs/examples/Makefile.m32

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-18 15:21:57 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20080618152157-j8b12047aqcl6kii
Tags: upstream-7.18.2
ImportĀ upstreamĀ versionĀ 7.18.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#########################################################################
 
2
# $Id: Makefile.m32,v 1.4 2008-05-09 16:31:51 yangtse Exp $
 
3
#
 
4
## Makefile for building curl examples with MingW32
 
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] [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
#########################################################################
 
15
 
 
16
# Edit the path below to point to the base of your Zlib sources.
 
17
ifndef ZLIB_PATH
 
18
ZLIB_PATH = ../../zlib-1.2.3
 
19
endif
 
20
# Edit the path below to point to the base of your OpenSSL package.
 
21
ifndef OPENSSL_PATH
 
22
OPENSSL_PATH = ../../openssl-0.9.8g
 
23
endif
 
24
# Edit the path below to point to the base of your LibSSH2 package.
 
25
ifndef LIBSSH2_PATH
 
26
LIBSSH2_PATH = ../../libssh2-0.18
 
27
endif
 
28
# Edit the path below to point to the base of your Novell LDAP NDK.
 
29
ifndef LDAP_SDK
 
30
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
 
31
endif
 
32
 
 
33
PROOT = ../..
 
34
ARES_LIB = $(PROOT)/ares
 
35
 
 
36
SSL = 1
 
37
ZLIB = 1
 
38
 
 
39
CC = gcc
 
40
CFLAGS = -g -O2 -Wall
 
41
# comment LDFLAGS below to keep debug info
 
42
LDFLAGS = -s
 
43
RC = windres
 
44
RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
 
45
RM = del /q /f > NUL 2>&1
 
46
CP = copy
 
47
 
 
48
########################################################
 
49
## Nothing more to do below this line!
 
50
 
 
51
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
 
52
LINK = $(CC) $(LDFLAGS) -o $@
 
53
 
 
54
ifdef DYN
 
55
  curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
 
56
  curl_LDADD = -L$(PROOT)/lib -lcurldll
 
57
else
 
58
  curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a
 
59
  curl_LDADD = -L$(PROOT)/lib -lcurl
 
60
  CFLAGS += -DCURL_STATICLIB
 
61
endif
 
62
ifdef ARES
 
63
  ifndef DYN
 
64
    curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
 
65
  endif
 
66
  CFLAGS += -DUSE_ARES
 
67
  curl_LDADD += -L$(ARES_LIB) -lcares
 
68
endif
 
69
ifdef SSH2
 
70
  CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
 
71
  curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
 
72
endif
 
73
ifdef SSL
 
74
  INCLUDES += -I"$(OPENSSL_PATH)/outinc"
 
75
  CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
 
76
  ifdef DYN
 
77
    curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
 
78
  else
 
79
    curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
 
80
  endif
 
81
endif
 
82
ifdef ZLIB
 
83
  INCLUDES += -I"$(ZLIB_PATH)"
 
84
  CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
 
85
  curl_LDADD += -L$(ZLIB_PATH) -lz
 
86
endif
 
87
ifdef SSPI
 
88
  CFLAGS += -DUSE_WINDOWS_SSPI
 
89
endif
 
90
ifdef IPV6
 
91
  CFLAGS += -DENABLE_IPV6
 
92
endif
 
93
ifdef LDAPS
 
94
  CFLAGS += -DHAVE_LDAP_SSL
 
95
endif
 
96
ifdef USE_LDAP_NOVELL
 
97
  CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
 
98
  curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
 
99
endif
 
100
ifdef USE_LDAP_OPENLDAP
 
101
  CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
 
102
  curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
 
103
endif
 
104
ifndef USE_LDAP_NOVELL
 
105
ifndef USE_LDAP_OPENLDAP
 
106
curl_LDADD += -lwldap32
 
107
endif
 
108
endif
 
109
curl_LDADD += -lws2_32
 
110
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
 
111
 
 
112
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
 
113
include Makefile.inc
 
114
 
 
115
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
 
116
 
 
117
.SUFFIXES: .rc .res .o .exe
 
118
 
 
119
 
 
120
all: $(example_PROGRAMS)
 
121
 
 
122
.o.exe: $(curl_DEPENDENCIES)
 
123
        $(LINK) $< $(curl_LDADD)
 
124
 
 
125
.c.o:
 
126
        $(COMPILE) -c $<
 
127
 
 
128
.rc.res:
 
129
        $(RC) $(RCFLAGS) $< -o $@
 
130
 
 
131
clean:
 
132
        $(RM) $(example_PROGRAMS)
 
133
 
 
134