-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.static
251 lines (224 loc) · 5.29 KB
/
Makefile.static
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
TARGET=libgnutls.a
TARGETXX=libgnutlsxx.a
ifdef LIBTASN1_DIR
LIBTASN1DIR=$(LIBTASN1_DIR)
else
LIBTASN1DIR=../libtasn1
endif
ifdef LIBGCRYPT_DIR
LIBGCRYPTDIR=$(LIBGCRYPT_DIR)
else
LIBGCRYPTDIR=../libgcrypt
endif
ifdef LIBGPGERR_DIR
LIBGPGERRDIR=$(LIBGPGERR_DIR)
else
LIBGPGERRDIR=../libgpg-error
endif
ifdef AWK_PATH
AWK := $(AWK_PATH)
else
AWK := $(shell which awk)
endif
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
ifeq ($(AWK),)
AWK := ../tools/osx/awk
endif
LN_S=ln -f -s
endif
ifeq ($(UNAME), Linux)
ifeq ($(AWK),)
$(error Please install awk for your distribution)
endif
LN_S=ln -f -s
endif
CFLAGS=-m32 -I. -Ilib -Ilib/includes -Ilibextra/includes -Ilib/x509 -Ilib/openpgp -Ilib/opencdk -Ilib/gl -Igl -Isrc -I$(LIBTASN1DIR)/lib -I$(LIBGCRYPTDIR)/src -I$(LIBGPGERRDIR)/src -Wall -O2 -DHAVE_CONFIG_H -DENABLE_OPENPGP -DENABLE_PKI -DENABLE_PSK -DENABLE_ANON -DENABLE_SRP -D_GCRYPT_IN_LIBGCRYPT
CLEANFILES=
ifeq ($(UNAME), Darwin)
check_arch = $(shell if as -arch $(1) -o /dev/null < /dev/null > /dev/null; then echo yes; else echo no; fi)
ifeq ($(call check_arch,i386), yes)
CFLAGS+=-arch i386
endif
ifeq ($(call check_arch,ppc), yes)
CFLAGS+=-arch ppc
endif
CFLAGS+=-fPIC -DPIC -fvisibility=hidden
$(shell ln -s -f byteswap.in.h lib/gl/byteswap.h)
CLEANFILES+=lib/gl/byteswap.h
endif
ifeq ($(UNAME), Linux)
CFLAGS+=-fPIC -DPIC -fvisibility=hidden
endif
WIN32=
ifeq ($(findstring CYG,$(UNAME)), CYG)
WIN32=1
CC=gcc-3
endif
ifeq ($(findstring MINGW,$(UNAME)), MINGW)
WIN32=1
CC=gcc
endif
ifdef WIN32
CFLAGS+=-DWIN32 -Ilib/includes/missing \
-DHAVE_WINSOCK2_H=1 \
-DIN_LIBINTL=1 \
-DEWOULDBLOCK=WSAEWOULDBLOCK \
-DEOVERFLOW=75
$(shell ln -s -f byteswap.in.h lib/gl/byteswap.h)
CLEANFILES+=lib/gl/byteswap.h
endif
CXXFLAGS=$(CFLAGS)
objects= \
lib/gnutls_record.o \
lib/gnutls_compress.o \
lib/debug.o \
lib/gnutls_cipher.o \
lib/gnutls_buffers.o \
lib/gnutls_handshake.o \
lib/gnutls_num.o \
lib/gnutls_errors.o \
lib/gnutls_algorithms.o \
lib/gnutls_dh.o \
lib/gnutls_kx.o \
lib/gnutls_priority.o \
lib/gnutls_hash_int.o \
lib/gnutls_cipher_int.o \
lib/gnutls_session.o \
lib/gnutls_db.o \
lib/x509_b64.o \
lib/auth_anon.o \
lib/ext_safe_renegotiation.o \
lib/gnutls_extensions.o \
lib/gnutls_auth.o \
lib/gnutls_v2_compat.o \
lib/gnutls_datum.o \
lib/auth_rsa.o \
lib/gnutls_session_pack.o \
lib/gnutls_mpi.o \
lib/gnutls_pk.o \
lib/gnutls_cert.o \
lib/gnutls_global.o \
lib/gnutls_constate.o \
lib/gnutls_anon_cred.o \
lib/pkix_asn1_tab.o \
lib/gnutls_asn1_tab.o \
lib/gnutls_mem.o \
lib/ext_signature.o \
lib/auth_cert.o \
lib/gnutls_ui.o \
lib/gnutls_sig.o \
lib/auth_dhe.o \
lib/gnutls_dh_primes.o \
lib/ext_max_record.o \
lib/gnutls_alert.o \
lib/gnutls_str.o \
lib/gnutls_state.o \
lib/gnutls_x509.o \
lib/ext_cert_type.o \
lib/gnutls_rsa_export.o \
lib/auth_rsa_export.o \
lib/ext_server_name.o \
lib/auth_dh_common.o \
lib/gnutls_helper.o \
lib/gnutls_supplemental.o \
lib/crypto.o \
lib/cryptodev.o \
lib/random.o \
lib/pk-libgcrypt.o \
lib/mpi-libgcrypt.o \
lib/rnd-libgcrypt.o \
lib/cipher-libgcrypt.o \
lib/mac-libgcrypt.o \
lib/ext_srp.o \
lib/gnutls_srp.o \
lib/auth_srp.o \
lib/auth_srp_passwd.o \
lib/auth_srp_sb64.o \
lib/auth_srp_rsa.o \
lib/auth_psk.o \
lib/auth_psk_passwd.o \
lib/gnutls_psk.o \
lib/auth_dhe_psk.o \
lib/gnutls_psk_netconf.o \
gl/c-ctype.o \
gl/close-hook.o \
gl/sockets.o \
gl/asnprintf.o \
gl/printf-args.o \
gl/printf-parse.o \
gl/read-file.o \
gl/vasnprintf.o \
src/common.o \
lib/x509/common.o \
lib/x509/crl.o \
lib/x509/crl_write.o \
lib/x509/crq.o \
lib/x509/dn.o \
lib/x509/extensions.o \
lib/x509/mpi.o \
lib/x509/output.o \
lib/x509/pbkdf2-sha1.o \
lib/x509/pkcs12.o \
lib/x509/pkcs12_bag.o \
lib/x509/pkcs12_encr.o \
lib/x509/pkcs7.o \
lib/x509/privkey.o \
lib/x509/privkey_pkcs8.o \
lib/x509/rfc2818_hostname.o \
lib/x509/sign.o \
lib/x509/verify.o \
lib/x509/x509.o \
lib/x509/x509_write.o \
lib/openpgp/pgp.o \
lib/openpgp/pgpverify.o \
lib/openpgp/extras.o \
lib/openpgp/compat.o \
lib/openpgp/lt1-privkey.o \
lib/openpgp/lt2-output.o \
lib/openpgp/gnutls_openpgp.o \
lib/opencdk/armor.o \
lib/opencdk/main.o \
lib/opencdk/kbnode.o \
lib/opencdk/dummy.o \
lib/opencdk/sig-check.o \
lib/opencdk/lt3-verify.o \
lib/opencdk/hash.o \
lib/opencdk/keydb.o \
lib/opencdk/pubkey.o \
lib/opencdk/stream.o \
lib/opencdk/write-packet.o \
lib/opencdk/misc.o \
lib/opencdk/seskey.o \
lib/opencdk/literal.o \
lib/opencdk/new-packet.o \
lib/opencdk/read-packet.o \
ifeq ($(UNAME), Darwin)
objects+=lib/gl/memmem.o
endif
ifdef WIN32
objects+=gl/socket.o \
lib/gl/memmem.o \
lib/gl/time_r.o \
lib/gl/asprintf.o \
lib/gl/vasprintf.o
endif
objectsxx= \
lib/gnutlsxx.cpp.o \
all: $(TARGET) $(TARGETXX)
%.o: %.c
$(CC) -o $@ $(CFLAGS) -c $<
%.cpp.o: %.cpp
$(CXX) -o $@ $(CXXFLAGS) -c $<
lib/openpgp/lt1-privkey.o: lib/openpgp/privkey.c
$(CC) -o $@ $(CFLAGS) -c $<
lib/openpgp/lt2-output.o: lib/openpgp/output.c
$(CC) -o $@ $(CFLAGS) -c $<
lib/opencdk/lt3-verify.o: lib/opencdk/verify.c
$(CC) -o $@ $(CFLAGS) -c $<
$(TARGET): $(objects)
$(AR) rcs $@ $(objects)
$(TARGETXX): $(objectsxx)
$(AR) rcs $@ $(objectsxx)
clean:
rm -f lib/*.o lib/x509/*.o lib/opencdk/*.o lib/openpgp/*.o src/*.o gl/*.o $(TARGET) $(TARGETXX) $(CLEANFILES)