109
# This is the location of fipscanister.o and friends.
110
# The FIPS module build will place it $(INSTALLTOP)/lib
111
# but since $(INSTALLTOP) can only take the default value
112
# when the module is built it will be in /usr/local/ssl/lib
113
# $(INSTALLTOP) for this build make be different so hard
116
FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
118
# This is set to "y" if fipscanister.o is compiled internally as
119
# opposed to coming from an external validated location.
121
FIPSCANISTERINTERNAL=n
123
# The location of the library which contains fipscanister.o
124
# normally it will be libcrypto unless fipsdso is set in which
125
# case it will be libfips. If not compiling in FIPS mode at all
126
# this is empty making it a useful test for a FIPS compile.
130
# Shared library base address. Currently only used on Windows.
135
DIRS= crypto fips ssl engines apps tools
136
SHLIBDIRS= crypto ssl fips
112
DIRS= crypto ssl engines apps tools
114
SHLIBDIRS= crypto ssl
138
116
# dirs in crypto to build
141
md2 md4 md5 sha mdc2 hmac ripemd \
142
des aes rc2 rc4 rc5 idea bf cast camellia seed \
119
md2 md4 md5 sha mdc2 hmac ripemd whrlpool \
120
des aes rc2 rc4 rc5 idea bf cast camellia seed modes \
143
121
bn ec rsa dsa ecdsa dh ecdh dso engine \
144
122
buffer bio stack lhash rand err \
145
123
evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
146
store cms pqueue jpake
124
cms pqueue ts jpake store
147
125
# keep in mind that the above list is adjusted by ./Configure
148
126
# according to no-xxx arguments...
198
177
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
199
178
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
201
BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
202
CC='${CC}' CFLAG='${CFLAG}' \
203
AS='${CC}' ASFLAG='${CFLAG} -c' \
204
AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}' \
205
SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/$(LIBDIR)' \
206
INSTALL_PREFIX='${INSTALL_PREFIX}' \
207
INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' \
209
MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
210
DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}' \
211
MAKEDEPPROG='${MAKEDEPPROG}' \
212
SHARED_LDFLAGS='${SHARED_LDFLAGS}' \
213
KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' \
214
EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' \
215
SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
216
PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' \
217
CPUID_OBJ='${CPUID_OBJ}' \
218
BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' \
219
AES_ASM_OBJ='${AES_ASM_OBJ}' \
220
BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' \
221
RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' \
222
SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \
223
MD5_ASM_OBJ='${MD5_ASM_OBJ}' \
224
RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \
225
FIPSLIBDIR='${FIPSLIBDIR}' \
226
FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
227
FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}' \
228
FIPS_EX_OBJ='${FIPS_EX_OBJ}' \
180
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
181
CC='$(CC)' CFLAG='$(CFLAG)' \
182
AS='$(CC)' ASFLAG='$(CFLAG) -c' \
183
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
184
CROSS_COMPILE='$(CROSS_COMPILE)' \
185
PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
186
SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
187
INSTALL_PREFIX='$(INSTALL_PREFIX)' \
188
INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
190
MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
191
DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
192
MAKEDEPPROG='$(MAKEDEPPROG)' \
193
SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
194
KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
195
ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
196
EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
197
SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
198
PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
199
CPUID_OBJ='$(CPUID_OBJ)' \
200
BN_ASM='$(BN_ASM)' DES_ENC='$(DES_ENC)' \
201
AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
202
BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
203
RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
204
SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
205
MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
206
RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
207
WP_ASM_OBJ='$(WP_ASM_OBJ)' \
208
PERLASM_SCHEME='$(PERLASM_SCHEME)' \
229
209
THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
230
210
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
231
211
# which in turn eliminates ambiguities in variable treatment with -e.
244
224
# subdirectories defined in $(DIRS). It requires that the target
245
225
# is given through the shell variable `target'.
246
226
BUILD_CMD= if [ -d "$$dir" ]; then \
247
( [ $$target != all -a -z "$(FIPSCANLIB)" ] && FIPSCANLIB=/dev/null; \
248
cd $$dir && echo "making $$target in $$dir..." && \
227
( cd $$dir && echo "making $$target in $$dir..." && \
249
228
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
252
231
RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
254
if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
233
if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
259
238
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
261
FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
262
../crypto/aes/aes_ecb.o \
263
../crypto/aes/aes_ofb.o \
264
../crypto/bn/bn_add.o \
265
../crypto/bn/bn_blind.o \
266
../crypto/bn/bn_ctx.o \
267
../crypto/bn/bn_div.o \
268
../crypto/bn/bn_exp2.o \
269
../crypto/bn/bn_exp.o \
270
../crypto/bn/bn_gcd.o \
271
../crypto/bn/bn_lib.o \
272
../crypto/bn/bn_mod.o \
273
../crypto/bn/bn_mont.o \
274
../crypto/bn/bn_mul.o \
275
../crypto/bn/bn_prime.o \
276
../crypto/bn/bn_rand.o \
277
../crypto/bn/bn_recp.o \
278
../crypto/bn/bn_shift.o \
279
../crypto/bn/bn_sqr.o \
280
../crypto/bn/bn_word.o \
281
../crypto/bn/bn_x931p.o \
282
../crypto/buffer/buf_str.o \
283
../crypto/cryptlib.o \
284
../crypto/des/cfb64ede.o \
285
../crypto/des/cfb64enc.o \
286
../crypto/des/cfb_enc.o \
287
../crypto/des/ecb3_enc.o \
288
../crypto/des/ecb_enc.o \
289
../crypto/des/ofb64ede.o \
290
../crypto/des/ofb64enc.o \
291
../crypto/des/fcrypt.o \
292
../crypto/des/set_key.o \
293
../crypto/dsa/dsa_utl.o \
294
../crypto/dsa/dsa_sign.o \
295
../crypto/dsa/dsa_vrf.o \
296
../crypto/err/err.o \
297
../crypto/evp/digest.o \
298
../crypto/evp/enc_min.o \
299
../crypto/evp/e_aes.o \
300
../crypto/evp/e_des3.o \
301
../crypto/evp/p_sign.o \
302
../crypto/evp/p_verify.o \
303
../crypto/mem_clr.o \
305
../crypto/rand/md_rand.o \
306
../crypto/rand/rand_egd.o \
307
../crypto/rand/randfile.o \
308
../crypto/rand/rand_lib.o \
309
../crypto/rand/rand_os2.o \
310
../crypto/rand/rand_unix.o \
311
../crypto/rand/rand_win.o \
312
../crypto/rsa/rsa_lib.o \
313
../crypto/rsa/rsa_none.o \
314
../crypto/rsa/rsa_oaep.o \
315
../crypto/rsa/rsa_pk1.o \
316
../crypto/rsa/rsa_pss.o \
317
../crypto/rsa/rsa_ssl.o \
318
../crypto/rsa/rsa_x931.o \
319
../crypto/sha/sha1dgst.o \
320
../crypto/sha/sha256.o \
321
../crypto/sha/sha512.o \
324
240
sub_all: build_all
325
241
build_all: build_libs build_apps build_tests build_tools
327
build_libs: build_crypto build_fips build_ssl build_shared build_engines
243
build_libs: build_crypto build_ssl build_engines
330
if [ -n "$(FIPSCANLIB)" ]; then \
331
EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
332
ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
336
dir=crypto; target=all; $(BUILD_ONE_CMD)
338
@dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
339
build_ssl: build_crypto
246
@dir=crypto; target=all; $(BUILD_ONE_CMD)
340
248
@dir=ssl; target=all; $(BUILD_ONE_CMD)
341
build_engines: build_crypto
342
250
@dir=engines; target=all; $(BUILD_ONE_CMD)
343
build_apps: build_libs
344
252
@dir=apps; target=all; $(BUILD_ONE_CMD)
345
build_tests: build_libs
346
254
@dir=test; target=all; $(BUILD_ONE_CMD)
347
build_tools: build_libs
348
256
@dir=tools; target=all; $(BUILD_ONE_CMD)
350
258
all_testapps: build_libs build_testapps
352
260
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
354
build_shared: $(SHARED_LIBS)
355
libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
262
libcrypto$(SHLIB_EXT): libcrypto.a
356
263
@if [ "$(SHLIB_TARGET)" != "" ]; then \
357
if [ "$(FIPSCANLIB)" = "libfips" ]; then \
358
$(ARD) libcrypto.a fipscanister.o ; \
359
$(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
360
$(AR) libcrypto.a fips/fipscanister.o ; \
362
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
363
FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
364
export CC FIPSLD_CC; \
366
$(MAKE) -e SHLIBDIRS='crypto' build-shared; \
264
$(MAKE) SHLIBDIRS=crypto build-shared; \
369
266
echo "There's no support for shared libraries on this platform" >&2; \
373
270
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
374
271
@if [ "$(SHLIB_TARGET)" != "" ]; then \
375
shlibdeps=-lcrypto; \
376
[ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
377
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
379
echo "There's no support for shared libraries on this platform" >&2 ; \
383
fips/fipscanister.o: build_fips
384
libfips$(SHLIB_EXT): fips/fipscanister.o
385
@if [ "$(SHLIB_TARGET)" != "" ]; then \
386
FIPSLD_CC="$(CC)"; CC=fips/fipsld; export CC FIPSLD_CC; \
387
$(MAKE) -f Makefile.shared -e $(BUILDENV) \
388
CC=$${CC} LIBNAME=fips THIS=$@ \
389
LIBEXTRAS=fips/fipscanister.o \
390
LIBDEPS="$(EX_LIBS)" \
391
LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
392
link_o.$(SHLIB_TARGET) || { rm -f $@; exit 1; } \
272
$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
394
274
echo "There's no support for shared libraries on this platform" >&2; \
399
dir=fips; target=all; $(BUILD_ONE_CMD)
402
279
@set -e; for i in $(SHLIBDIRS); do \
403
280
if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
424
301
build-shared: do_$(SHLIB_TARGET) link-shared
426
303
do_$(SHLIB_TARGET):
427
@ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
428
if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
304
@ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
305
if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \
429
306
libs="$(LIBKRB5) $$libs"; \
431
308
$(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
432
LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
433
LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
309
LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
310
LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
434
311
LIBDEPS="$$libs $(EX_LIBS)" \
435
312
link_a.$(SHLIB_TARGET); \
436
313
libs="-l$$i $$libs"; \
510
387
@$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
511
388
@$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
512
389
@set -e; target=links; $(RECURSIVE_BUILD_CMD)
513
@if [ -z "$(FIPSCANLIB)" ]; then \
514
set -e; target=links; dir=fips ; $(BUILD_CMD) ; \
518
392
@(cd test && echo "generating dummy tests (if needed)..." && \
519
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
393
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
396
rm -rf *.bak include/openssl certs/.0
523
397
@set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
525
399
rehash: rehash.time
526
400
rehash.time: certs apps
527
401
@if [ -z "$(CROSS_COMPILE)" ]; then \
528
402
(OPENSSL="`pwd`/util/opensslwrap.sh"; \
403
[ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
529
404
OPENSSL_DEBUG_MEMORY=on; \
530
405
export OPENSSL OPENSSL_DEBUG_MEMORY; \
531
406
$(PERL) tools/c_rehash certs) && \
532
407
touch rehash.time; \
538
413
@(cd test && echo "testing..." && \
539
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
540
util/opensslwrap.sh version -a
414
$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
415
OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
543
418
@$(PERL) util/selftest.pl
684
571
cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
685
572
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
576
for subdir in apps crypto ssl; do \
577
mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
578
for i in doc/$$subdir/*.pod; do \
579
fn=`basename $$i .pod`; \
580
echo "installing html/$$fn.$(HTMLSUFFIX)"; \
582
| sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
583
| pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \
584
| sed -r 's/<!DOCTYPE.*//g' \
585
> $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
586
$(PERL) util/extract-names.pl < $$i | \
587
grep -v $$filecase "^$$fn\$$" | \
588
(cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
590
PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
688
596
@$(PERL) $(TOP)/util/mkdir-p.pl \
689
597
$(INSTALL_PREFIX)$(MANDIR)/man1 \