~ubuntu-branches/ubuntu/lucid/openssl/lucid-proposed

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-06-13 18:15:46 UTC
  • mto: (11.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090613181546-vbfntai3b009dl1u
Tags: upstream-0.9.8k
ImportĀ upstreamĀ versionĀ 0.9.8k

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
## Makefile for OpenSSL
5
5
##
6
6
 
7
 
VERSION=0.9.8g
 
7
VERSION=0.9.8k
8
8
MAJOR=0
9
9
MINOR=9.8
10
10
SHLIB_VERSION_NUMBER=0.9.8
13
13
SHLIB_MINOR=9.8
14
14
SHLIB_EXT=
15
15
PLATFORM=dist
16
 
OPTIONS= no-camellia no-gmp no-krb5 no-mdc2 no-rc5 no-rfc3779 no-seed no-shared no-tlsext no-zlib no-zlib-dynamic
 
16
OPTIONS= no-camellia no-capieng no-cms no-gmp no-jpake no-krb5 no-mdc2 no-montasm no-rc5 no-rfc3779 no-seed no-shared no-zlib no-zlib-dynamic
17
17
CONFIGURE_ARGS=dist
18
18
SHLIB_TARGET=
19
19
 
61
61
 
62
62
CC= cc
63
63
CFLAG= -O
64
 
DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_TLSEXT 
 
64
DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED
65
65
PEX_LIBS= 
66
66
EX_LIBS= 
67
67
EXE_EXT= 
68
68
ARFLAGS= 
69
69
AR=ar $(ARFLAGS) r
 
70
ARD=ar $(ARFLAGS) d
70
71
RANLIB= /usr/bin/ranlib
71
72
PERL= /usr/bin/perl
72
73
TAR= tar
92
93
AES_ASM_OBJ= aes_core.o aes_cbc.o
93
94
BF_ENC= bf_enc.o
94
95
CAST_ENC= c_enc.o
95
 
RC4_ENC= rc4_enc.o
 
96
RC4_ENC= rc4_enc.o rc4_skey.o
96
97
RC5_ENC= rc5_enc.o
97
98
MD5_ASM_OBJ= 
98
99
SHA1_ASM_OBJ= 
106
107
ZLIB_INCLUDE=
107
108
LIBZLIB=
108
109
 
 
110
# This is the location of fipscanister.o and friends.
 
111
# The FIPS module build will place it $(INSTALLTOP)/lib
 
112
# but since $(INSTALLTOP) can only take the default value
 
113
# when the module is built it will be in /usr/local/ssl/lib
 
114
# $(INSTALLTOP) for this build make be different so hard
 
115
# code the path.
 
116
 
 
117
FIPSLIBDIR=/usr/local/ssl/fips-1.0/lib/
 
118
 
 
119
# This is set to "y" if fipscanister.o is compiled internally as
 
120
# opposed to coming from an external validated location.
 
121
 
 
122
FIPSCANISTERINTERNAL=n
 
123
 
 
124
# The location of the library which contains fipscanister.o
 
125
# normally it will be libcrypto unless fipsdso is set in which
 
126
# case it will be libfips. If not compiling in FIPS mode at all
 
127
# this is empty making it a useful test for a FIPS compile.
 
128
 
 
129
FIPSCANLIB=
 
130
 
 
131
# Shared library base address. Currently only used on Windows.
 
132
#
 
133
 
 
134
BASEADDR=0xFB00000
 
135
 
109
136
DIRS=   crypto ssl engines apps test tools
110
137
SHLIBDIRS= crypto ssl
111
138
 
140
167
LIBS=   libcrypto.a libssl.a
141
168
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
142
169
SHARED_SSL=libssl$(SHLIB_EXT)
 
170
SHARED_FIPS=
143
171
SHARED_LIBS=
144
172
SHARED_LIBS_LINK_EXTS=
145
173
SHARED_LDFLAGS=
193
221
                SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
194
222
                MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
195
223
                RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
 
224
                FIPSLIBDIR='${FIPSLIBDIR}'                      \
 
225
                FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}"      \
 
226
                FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}'  \
 
227
                FIPS_EX_OBJ='${FIPS_EX_OBJ}'    \
196
228
                THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
197
229
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
198
230
# which in turn eliminates ambiguities in variable treatment with -e.
211
243
# subdirectories defined in $(DIRS).  It requires that the target
212
244
# is given through the shell variable `target'.
213
245
BUILD_CMD=  if [ -d "$$dir" ]; then \
214
 
            (   cd $$dir && echo "making $$target in $$dir..." && \
 
246
            (   [ $$target != all -a -z "$(FIPSCANLIB)" ] && FIPSCANLIB=/dev/null; \
 
247
                cd $$dir && echo "making $$target in $$dir..." && \
215
248
                $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
216
249
            ) || exit 1; \
217
250
            fi
224
257
reflect:
225
258
        @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
226
259
 
 
260
FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
 
261
        ../crypto/aes/aes_ecb.o \
 
262
        ../crypto/aes/aes_ofb.o \
 
263
        ../crypto/bn/bn_add.o \
 
264
        ../crypto/bn/bn_blind.o \
 
265
        ../crypto/bn/bn_ctx.o \
 
266
        ../crypto/bn/bn_div.o \
 
267
        ../crypto/bn/bn_exp2.o \
 
268
        ../crypto/bn/bn_exp.o \
 
269
        ../crypto/bn/bn_gcd.o \
 
270
        ../crypto/bn/bn_lib.o \
 
271
        ../crypto/bn/bn_mod.o \
 
272
        ../crypto/bn/bn_mont.o \
 
273
        ../crypto/bn/bn_mul.o \
 
274
        ../crypto/bn/bn_prime.o \
 
275
        ../crypto/bn/bn_rand.o \
 
276
        ../crypto/bn/bn_recp.o \
 
277
        ../crypto/bn/bn_shift.o \
 
278
        ../crypto/bn/bn_sqr.o \
 
279
        ../crypto/bn/bn_word.o \
 
280
        ../crypto/bn/bn_x931p.o \
 
281
        ../crypto/buffer/buf_str.o \
 
282
        ../crypto/cryptlib.o \
 
283
        ../crypto/des/cfb64ede.o \
 
284
        ../crypto/des/cfb64enc.o \
 
285
        ../crypto/des/cfb_enc.o \
 
286
        ../crypto/des/ecb3_enc.o \
 
287
        ../crypto/des/ecb_enc.o \
 
288
        ../crypto/des/ofb64ede.o \
 
289
        ../crypto/des/ofb64enc.o \
 
290
        ../crypto/des/fcrypt.o \
 
291
        ../crypto/des/set_key.o \
 
292
        ../crypto/dsa/dsa_utl.o \
 
293
        ../crypto/dsa/dsa_sign.o \
 
294
        ../crypto/dsa/dsa_vrf.o \
 
295
        ../crypto/err/err.o \
 
296
        ../crypto/evp/digest.o \
 
297
        ../crypto/evp/enc_min.o \
 
298
        ../crypto/evp/e_aes.o \
 
299
        ../crypto/evp/e_des3.o \
 
300
        ../crypto/evp/p_sign.o \
 
301
        ../crypto/evp/p_verify.o \
 
302
        ../crypto/mem_clr.o \
 
303
        ../crypto/mem.o \
 
304
        ../crypto/rand/md_rand.o \
 
305
        ../crypto/rand/rand_egd.o \
 
306
        ../crypto/rand/randfile.o \
 
307
        ../crypto/rand/rand_lib.o \
 
308
        ../crypto/rand/rand_os2.o \
 
309
        ../crypto/rand/rand_unix.o \
 
310
        ../crypto/rand/rand_win.o \
 
311
        ../crypto/rsa/rsa_lib.o \
 
312
        ../crypto/rsa/rsa_none.o \
 
313
        ../crypto/rsa/rsa_oaep.o \
 
314
        ../crypto/rsa/rsa_pk1.o \
 
315
        ../crypto/rsa/rsa_pss.o \
 
316
        ../crypto/rsa/rsa_ssl.o \
 
317
        ../crypto/rsa/rsa_x931.o \
 
318
        ../crypto/sha/sha1dgst.o \
 
319
        ../crypto/sha/sha256.o \
 
320
        ../crypto/sha/sha512.o \
 
321
        ../crypto/uid.o
 
322
 
227
323
sub_all: build_all
228
324
build_all: build_libs build_apps build_tests build_tools
229
325
 
230
 
build_libs: build_crypto build_ssl build_engines
 
326
build_libs: build_crypto build_fips build_ssl build_shared build_engines
231
327
 
232
328
build_crypto:
233
 
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
 
329
        if [ -n "$(FIPSCANLIB)" ]; then \
 
330
                EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
 
331
                ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
 
332
        else \
 
333
                ARX='${AR}' ; \
 
334
        fi ; export ARX ; \
 
335
                dir=crypto; target=all; $(BUILD_ONE_CMD)
 
336
build_fips:
 
337
        @dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
234
338
build_ssl:
235
339
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
236
340
build_engines:
246
350
build_testapps:
247
351
        @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
248
352
 
249
 
libcrypto$(SHLIB_EXT): libcrypto.a
 
353
build_shared:   $(SHARED_LIBS)
 
354
libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
250
355
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
251
 
                $(MAKE) SHLIBDIRS=crypto build-shared; \
 
356
                if [ "$(FIPSCANLIB)" = "libfips" ]; then \
 
357
                        $(ARD) libcrypto.a fipscanister.o ; \
 
358
                        $(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
 
359
                        $(AR) libcrypto.a fips/fipscanister.o ; \
 
360
                else \
 
361
                        if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
 
362
                                FIPSLD_CC=$(CC); CC=fips/fipsld; \
 
363
                                export CC FIPSLD_CC; \
 
364
                        fi; \
 
365
                        $(MAKE) -e SHLIBDIRS='crypto' build-shared; \
 
366
                fi \
252
367
        else \
253
368
                echo "There's no support for shared libraries on this platform" >&2; \
254
369
                exit 1; \
256
371
 
257
372
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
258
373
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
259
 
                $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
 
374
                shlibdeps=-lcrypto; \
 
375
                [ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
 
376
                $(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
 
377
        else \
 
378
                echo "There's no support for shared libraries on this platform" >&2 ; \
 
379
                exit 1; \
 
380
        fi
 
381
 
 
382
fips/fipscanister.o:    build_fips
 
383
libfips$(SHLIB_EXT):            fips/fipscanister.o
 
384
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
 
385
                FIPSLD_CC=$(CC); CC=fips/fipsld; export CC FIPSLD_CC; \
 
386
                $(MAKE) -f Makefile.shared -e $(BUILDENV) \
 
387
                        CC=$${CC} LIBNAME=fips THIS=$@ \
 
388
                        LIBEXTRAS=fips/fipscanister.o \
 
389
                        LIBDEPS="$(EX_LIBS)" \
 
390
                        LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
 
391
                        link_o.$(SHLIB_TARGET) || { rm -f $@; exit 1; } \
260
392
        else \
261
393
                echo "There's no support for shared libraries on this platform" >&2; \
262
394
                exit 1; \
263
395
        fi
264
396
 
 
397
libfips.a:
 
398
        dir=fips; target=all; $(BUILD_ONE_CMD)
 
399
 
265
400
clean-shared:
266
401
        @set -e; for i in $(SHLIBDIRS); do \
267
402
                if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
371
506
        @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
372
507
        @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
373
508
        @set -e; target=links; $(RECURSIVE_BUILD_CMD)
 
509
        @if [ -z "$(FIPSCANLIB)" ]; then \
 
510
                set -e; target=links; dir=fips ; $(BUILD_CMD) ; \
 
511
        fi
374
512
 
375
513
gentests:
376
514
        @(cd test && echo "generating dummy tests (if needed)..." && \