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
117
FIPSLIBDIR=/usr/local/ssl/fips-1.0/lib/
119
# This is set to "y" if fipscanister.o is compiled internally as
120
# opposed to coming from an external validated location.
122
FIPSCANISTERINTERNAL=n
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.
131
# Shared library base address. Currently only used on Windows.
109
136
DIRS= crypto ssl engines apps test tools
110
137
SHLIBDIRS= crypto ssl
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 \
225
258
@[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
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 \
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 \
227
323
sub_all: build_all
228
324
build_all: build_libs build_apps build_tests build_tools
230
build_libs: build_crypto build_ssl build_engines
326
build_libs: build_crypto build_fips build_ssl build_shared build_engines
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)' ; \
335
dir=crypto; target=all; $(BUILD_ONE_CMD)
337
@dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
235
339
@dir=ssl; target=all; $(BUILD_ONE_CMD)
247
351
@dir=crypto; target=testapps; $(BUILD_ONE_CMD)
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 ; \
361
if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
362
FIPSLD_CC=$(CC); CC=fips/fipsld; \
363
export CC FIPSLD_CC; \
365
$(MAKE) -e SHLIBDIRS='crypto' build-shared; \
253
368
echo "There's no support for shared libraries on this platform" >&2; \
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; \
378
echo "There's no support for shared libraries on this platform" >&2 ; \
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; } \
261
393
echo "There's no support for shared libraries on this platform" >&2; \
398
dir=fips; target=all; $(BUILD_ONE_CMD)
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) ; \
376
514
@(cd test && echo "generating dummy tests (if needed)..." && \