]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.fips
Add ECDSA functionality to fips module. Initial very incomplete version
[thirdparty/openssl.git] / Makefile.fips
CommitLineData
975138ed
DSH
1##
2## Makefile for OpenSSL: fipscanister.o only
3##
4
5VERSION=
6MAJOR=
7MINOR=
8SHLIB_VERSION_NUMBER=
9SHLIB_VERSION_HISTORY=
10SHLIB_MAJOR=
11SHLIB_MINOR=
12SHLIB_EXT=
13PLATFORM=dist
14OPTIONS=
15CONFIGURE_ARGS=
16SHLIB_TARGET=
17
18# HERE indicates where this Makefile lives. This can be used to indicate
19# where sub-Makefiles are expected to be. Currently has very limited usage,
20# and should probably not be bothered with at all.
21HERE=.
22
23# INSTALL_PREFIX is for package builders so that they can configure
24# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
25# Normally it is left empty.
26INSTALL_PREFIX=
27INSTALLTOP=/usr/local/ssl
28
29# Do not edit this manually. Use Configure --openssldir=DIR do change this!
30OPENSSLDIR=/usr/local/ssl
31
32# NO_IDEA - Define to build without the IDEA algorithm
33# NO_RC4 - Define to build without the RC4 algorithm
34# NO_RC2 - Define to build without the RC2 algorithm
35# THREADS - Define when building with threads, you will probably also need any
36# system defines as well, i.e. _REENTERANT for Solaris 2.[34]
37# TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
38# TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
39# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
40# DEVRANDOM - Give this the value of the 'random device' if your OS supports
41# one. 32 bytes will be read from this when the random
42# number generator is initalised.
43# SSL_FORBID_ENULL - define if you want the server to be not able to use the
44# NULL encryption ciphers.
45#
46# LOCK_DEBUG - turns on lots of lock debug output :-)
47# REF_CHECK - turn on some xyz_free() assertions.
48# REF_PRINT - prints some stuff on structure free.
49# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
50# MFUNC - Make all Malloc/Free/Realloc calls call
51# CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
52# call application defined callbacks via CRYPTO_set_mem_functions()
53# MD5_ASM needs to be defined to use the x86 assembler for MD5
54# SHA1_ASM needs to be defined to use the x86 assembler for SHA1
55# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
56# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
57# equal 4.
58# PKCS1_CHECK - pkcs1 tests.
59
60CC= cc
61CFLAG= -O
62DEPFLAG=
63PEX_LIBS=
64EX_LIBS=
65EXE_EXT=
66ARFLAGS=
67AR=ar $(ARFLAGS) r
68RANLIB= ranlib
69NM= nm
70PERL= perl
71TAR= tar
72TARFLAGS= --no-recursion
73MAKEDEPPROG=makedepend
74LIBDIR=lib
75
76# We let the C compiler driver to take care of .s files. This is done in
77# order to be excused from maintaining a separate set of architecture
78# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
79# gcc, then the driver will automatically translate it to -xarch=v8plus
80# and pass it down to assembler.
81AS=$(CC) -c
82ASFLAG=$(CFLAG)
83
84# For x86 assembler: Set PROCESSOR to 386 if you want to support
85# the 80386.
86PROCESSOR=
87
88# CPUID module collects small commonly used assembler snippets
89CPUID_OBJ=
90BN_ASM= bn_asm.o
91DES_ENC= des_enc.o fcrypt_b.o
92AES_ENC= aes_core.o aes_cbc.o
93BF_ENC= bf_enc.o
94CAST_ENC= c_enc.o
95RC4_ENC= rc4_enc.o
96RC5_ENC= rc5_enc.o
97MD5_ASM_OBJ=
98SHA1_ASM_OBJ=
99RMD160_ASM_OBJ=
100WP_ASM_OBJ=
101CMLL_ENC=
102MODES_ASM_OBJ=
103PERLASM_SCHEME=
104
105# KRB5 stuff
106KRB5_INCLUDES=
107LIBKRB5=
108
109# Zlib stuff
110ZLIB_INCLUDE=
111LIBZLIB=
112
113# This is the location of fipscanister.o and friends.
114# The FIPS module build will place it $(INSTALLTOP)/lib
115# but since $(INSTALLTOP) can only take the default value
116# when the module is built it will be in /usr/local/ssl/lib
117# $(INSTALLTOP) for this build may be different so hard
118# code the path.
119
120FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
121
122# This is set to "y" if fipscanister.o is compiled internally as
123# opposed to coming from an external validated location.
124
125FIPSCANISTERINTERNAL=n
126
127# This is set if we only build fipscanister.o
128
129FIPSCANISTERONLY=y
130
131# The location of the library which contains fipscanister.o
132# normally it will be libcrypto unless fipsdso is set in which
133# case it will be libfips. If not compiling in FIPS mode at all
134# this is empty making it a useful test for a FIPS compile.
135
136FIPSCANLIB=
137
138# Shared library base address. Currently only used on Windows.
139#
140
141BASEADDR=
142
143DIRS= crypto fips test tools
144ENGDIRS= ccgost
145SHLIBDIRS= crypto
146
147# dirs in crypto to build
148SDIRS= \
149 sha hmac des aes modes \
150 bn ec rsa dsa ecdsa dh ecdh \
151 buffer rand err evp cmac
152# keep in mind that the above list is adjusted by ./Configure
153# according to no-xxx arguments...
154
155# tests to perform. "alltests" is a special word indicating that all tests
156# should be performed.
157TESTS = alltests
158
159MAKEFILE= Makefile
160
161MANDIR=$(OPENSSLDIR)/man
162MAN1=1
163MAN3=3
164MANSUFFIX=
165HTMLSUFFIX=html
166HTMLDIR=$(OPENSSLDIR)/html
167SHELL=/bin/sh
168
169TOP= .
170ONEDIRS=out tmp
171EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
172WDIRS= windows
173LIBS=
174SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
175SHARED_SSL=libssl$(SHLIB_EXT)
176SHARED_LIBS=
177SHARED_LIBS_LINK_EXTS=
178SHARED_LDFLAGS=
179
180GENERAL= Makefile
181BASENAME= openssl
182NAME= $(BASENAME)-$(VERSION)
183TARFILE= $(NAME).tar
184WTARFILE= $(NAME)-win.tar
185EXHEADER= e_os2.h
186HEADER= e_os.h
187
188all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
189
190# as we stick to -e, CLEARENV ensures that local variables in lower
191# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
192# shell, which [annoyingly enough] terminates unset with error if VAR
193# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
194# which terminates unset with error if no variable was present:-(
195CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
196 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
197 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
198 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
199 $${EXHEADER+EXHEADER} $${HEADER+HEADER} \
200 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
201 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
202 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \
203 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
204 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
205
206BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
207 CC='$(CC)' CFLAG='$(CFLAG)' \
208 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
209 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
210 CROSS_COMPILE='$(CROSS_COMPILE)' \
211 PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
212 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
213 INSTALL_PREFIX='$(INSTALL_PREFIX)' \
214 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
215 LIBDIR='$(LIBDIR)' \
216 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
217 DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
218 MAKEDEPPROG='$(MAKEDEPPROG)' \
219 SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
220 KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
221 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
222 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
223 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
224 PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
225 CPUID_OBJ='$(CPUID_OBJ)' \
226 BN_ASM='$(BN_ASM)' DES_ENC='$(DES_ENC)' \
227 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
228 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
229 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
230 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
231 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
232 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
233 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
234 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
235 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
236 FIPSLIBDIR='${FIPSLIBDIR}' \
237 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
238 FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}' \
239 FIPSCANISTERONLY='${FIPSCANISTERONLY}' \
240 FIPS_EX_OBJ='${FIPS_EX_OBJ}' \
241 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
242# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
243# which in turn eliminates ambiguities in variable treatment with -e.
244
245# BUILD_CMD is a generic macro to build a given target in a given
246# subdirectory. The target must be given through the shell variable
247# `target' and the subdirectory to build in must be given through `dir'.
248# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
249# BUILD_ONE_CMD instead.
250#
251# BUILD_ONE_CMD is a macro to build a given target in a given
252# subdirectory if that subdirectory is part of $(DIRS). It requires
253# exactly the same shell variables as BUILD_CMD.
254#
255# RECURSIVE_BUILD_CMD is a macro to build a given target in all
256# subdirectories defined in $(DIRS). It requires that the target
257# is given through the shell variable `target'.
258BUILD_CMD= if [ -d "$$dir" ]; then \
259 ( cd $$dir && echo "making $$target in $$dir..." && \
260 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
261 ) || exit 1; \
262 fi
263RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
264BUILD_ONE_CMD=\
265 if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
266 $(BUILD_CMD); \
267 fi
268
269reflect:
270 @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
271
975138ed
DSH
272# FIXME
273
274FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
275 ../crypto/aes/aes_ecb.o \
276 ../crypto/aes/aes_ofb.o \
277 ../crypto/bn/bn_add.o \
278 ../crypto/bn/bn_blind.o \
279 ../crypto/bn/bn_ctx.o \
280 ../crypto/bn/bn_div.o \
281 ../crypto/bn/bn_exp2.o \
282 ../crypto/bn/bn_exp.o \
283 ../crypto/bn/bn_gcd.o \
fe26d066 284 ../crypto/bn/bn_gf2m.o \
975138ed
DSH
285 ../crypto/bn/bn_lib.o \
286 ../crypto/bn/bn_mod.o \
287 ../crypto/bn/bn_mont.o \
288 ../crypto/bn/bn_mul.o \
fe26d066 289 ../crypto/bn/bn_nist.o \
975138ed
DSH
290 ../crypto/bn/bn_prime.o \
291 ../crypto/bn/bn_rand.o \
292 ../crypto/bn/bn_recp.o \
293 ../crypto/bn/bn_shift.o \
294 ../crypto/bn/bn_sqr.o \
295 ../crypto/bn/bn_word.o \
296 ../crypto/bn/bn_x931p.o \
297 ../crypto/buffer/buf_str.o \
298 ../crypto/cryptlib.o \
299 ../crypto/des/cfb64ede.o \
300 ../crypto/des/cfb64enc.o \
301 ../crypto/des/cfb_enc.o \
302 ../crypto/des/ecb3_enc.o \
303 ../crypto/des/ofb64ede.o \
304 ../crypto/des/fcrypt.o \
305 ../crypto/des/set_key.o \
306 ../crypto/dh/dh_check.o \
307 ../crypto/dh/dh_gen.o \
308 ../crypto/dh/dh_key.o \
309 ../crypto/dsa/dsa_gen.o \
310 ../crypto/dsa/dsa_key.o \
311 ../crypto/dsa/dsa_ossl.o \
fe26d066
DSH
312 ../crypto/ec/ec_curve.o \
313 ../crypto/ec/ec_cvt.o \
314 ../crypto/ec/ec_key.o \
315 ../crypto/ec/ec_lib.o \
316 ../crypto/ec/ecp_mont.o \
317 ../crypto/ec/ec_mult.o \
318 ../crypto/ec/ecp_nist.o \
319 ../crypto/ec/ecp_smpl.o \
320 ../crypto/ec/ec2_mult.o \
321 ../crypto/ec/ec2_smpl.o \
322 ../crypto/ecdsa/ecs_ossl.o \
975138ed
DSH
323 ../crypto/evp/e_aes.o \
324 ../crypto/evp/e_des3.o \
325 ../crypto/evp/m_sha1.o \
326 ../crypto/hmac/hmac.o \
327 ../crypto/modes/cbc128.o \
328 ../crypto/modes/cfb128.o \
329 ../crypto/modes/ctr128.o \
330 ../crypto/modes/gcm128.o \
331 ../crypto/modes/ofb128.o \
332 ../crypto/rand/md_rand.o \
333 ../crypto/rand/rand_egd.o \
334 ../crypto/rand/randfile.o \
335 ../crypto/rand/rand_lib.o \
336 ../crypto/rand/rand_os2.o \
337 ../crypto/rand/rand_unix.o \
338 ../crypto/rand/rand_win.o \
339 ../crypto/rsa/rsa_eay.o \
340 ../crypto/rsa/rsa_gen.o \
341 ../crypto/rsa/rsa_crpt.o \
342 ../crypto/rsa/rsa_none.o \
343 ../crypto/rsa/rsa_oaep.o \
344 ../crypto/rsa/rsa_pk1.o \
345 ../crypto/rsa/rsa_pss.o \
346 ../crypto/rsa/rsa_ssl.o \
347 ../crypto/rsa/rsa_x931.o \
348 ../crypto/rsa/rsa_x931g.o \
349 ../crypto/sha/sha1dgst.o \
350 ../crypto/sha/sha256.o \
351 ../crypto/sha/sha512.o \
352 ../crypto/thr_id.o \
353 ../crypto/uid.o
354
355sub_all: build_all
356build_all: build_libs build_tests build_tools
357
358build_libs: build_crypto build_fips
359
360build_fips:
361 @dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
362
363build_crypto:
364 if [ -n "$(FIPSCANLIB)" ]; then \
365 EXCL_OBJ='$(AES_ENC) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(MODES_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
366 ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
367 else \
368 ARX='${AR}' ; \
369 fi ; export ARX ; \
370 dir=crypto; target=all; $(BUILD_ONE_CMD)
371build_ssl:
372 @dir=ssl; target=all; $(BUILD_ONE_CMD)
373build_engines:
374 @dir=engines; target=all; $(BUILD_ONE_CMD)
375build_apps:
376 @dir=apps; target=all; $(BUILD_ONE_CMD)
377build_tests:
378 @dir=test; target=fipsexe; $(BUILD_ONE_CMD)
379build_tools:
380 @dir=tools; target=all; $(BUILD_ONE_CMD)
381
382all_testapps: build_libs build_testapps
383build_testapps:
384 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
385
386libcrypto$(SHLIB_EXT): libcrypto.a build_fips
387 @if [ "$(SHLIB_TARGET)" != "" ]; then \
388 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
389 FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
390 export CC FIPSLD_CC; \
391 fi; \
392 $(MAKE) SHLIBDIRS=crypto build-shared; \
393 else \
394 echo "There's no support for shared libraries on this platform" >&2; \
395 exit 1; \
396 fi
397
398libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
399 @if [ "$(SHLIB_TARGET)" != "" ]; then \
400 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
401 else \
402 echo "There's no support for shared libraries on this platform" >&2; \
403 exit 1; \
404 fi
405
406clean-shared:
407 @set -e; for i in $(SHLIBDIRS); do \
408 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
409 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
410 for j in $${tmp:-x}; do \
411 ( set -x; rm -f lib$$i$$j ); \
412 done; \
413 fi; \
414 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
415 if [ "$(PLATFORM)" = "Cygwin" ]; then \
416 ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
417 fi; \
418 done
419
420link-shared:
421 @ set -e; for i in $(SHLIBDIRS); do \
422 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
423 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
424 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
425 symlink.$(SHLIB_TARGET); \
426 libs="$$libs -l$$i"; \
427 done
428
429build-shared: do_$(SHLIB_TARGET) link-shared
430
431do_$(SHLIB_TARGET):
432 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
433 if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \
434 libs="$(LIBKRB5) $$libs"; \
435 fi; \
436 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
437 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
438 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
439 LIBDEPS="$$libs $(EX_LIBS)" \
440 link_a.$(SHLIB_TARGET); \
441 libs="-l$$i $$libs"; \
442 done
443
444libcrypto.pc: Makefile
445 @ ( echo 'prefix=$(INSTALLTOP)'; \
446 echo 'exec_prefix=$${prefix}'; \
447 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
448 echo 'includedir=$${prefix}/include'; \
449 echo ''; \
450 echo 'Name: OpenSSL-libcrypto'; \
451 echo 'Description: OpenSSL cryptography library'; \
452 echo 'Version: '$(VERSION); \
453 echo 'Requires: '; \
454 echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
455 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
456
457libssl.pc: Makefile
458 @ ( echo 'prefix=$(INSTALLTOP)'; \
459 echo 'exec_prefix=$${prefix}'; \
460 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
461 echo 'includedir=$${prefix}/include'; \
462 echo ''; \
463 echo 'Name: OpenSSL'; \
464 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
465 echo 'Version: '$(VERSION); \
466 echo 'Requires: '; \
467 echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
468 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
469
470openssl.pc: Makefile
471 @ ( echo 'prefix=$(INSTALLTOP)'; \
472 echo 'exec_prefix=$${prefix}'; \
473 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
474 echo 'includedir=$${prefix}/include'; \
475 echo ''; \
476 echo 'Name: OpenSSL'; \
477 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
478 echo 'Version: '$(VERSION); \
479 echo 'Requires: '; \
480 echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
481 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
482
483Makefile: Makefile.org Configure config
484 @echo "Makefile is older than Makefile.org, Configure or config."
485 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
486 @false
487
488libclean:
489 rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
490
491clean: libclean
492 rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
493 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
494 rm -f $(LIBS)
495 rm -f openssl.pc libssl.pc libcrypto.pc
496 rm -f speed.* .pure
497 rm -f $(TARFILE)
498 @set -e; for i in $(ONEDIRS) ;\
499 do \
500 rm -fr $$i/*; \
501 done
502
503makefile.one: files
504 $(PERL) util/mk1mf.pl >makefile.one; \
505 sh util/do_ms.sh
506
507files:
508 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
509 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
510
511links:
512 @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
513 @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
514 @set -e; target=links; $(RECURSIVE_BUILD_CMD)
515
516gentests:
517 @(cd test && echo "generating dummy tests (if needed)..." && \
518 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
519
520dclean:
521 rm -rf *.bak include/openssl certs/.0
522 @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
523
524rehash: rehash.time
525rehash.time: certs apps
526 @if [ -z "$(CROSS_COMPILE)" ]; then \
527 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
528 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
529 OPENSSL_DEBUG_MEMORY=on; \
530 export OPENSSL OPENSSL_DEBUG_MEMORY; \
531 $(PERL) tools/c_rehash certs) && \
532 touch rehash.time; \
533 else :; fi
534
535test: tests
536
537tests: rehash
538 @(cd test && echo "testing..." && \
539 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
540 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
541
542report:
543 @$(PERL) util/selftest.pl
544
545depend:
546 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
547
548lint:
549 @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
550
551tags:
552 rm -f TAGS
553 find . -name '[^.]*.[ch]' | xargs etags -a
554
555errors:
556 $(PERL) util/mkerr.pl -recurse -write
557 (cd engines; $(MAKE) PERL=$(PERL) errors)
558 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
559
560stacks:
561 $(PERL) util/mkstack.pl -write
562
563util/libeay.num::
564 $(PERL) util/mkdef.pl crypto update
565
566util/ssleay.num::
567 $(PERL) util/mkdef.pl ssl update
568
569crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
570 $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
571crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
572 $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
573crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
574 $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
575
576apps/openssl-vms.cnf: apps/openssl.cnf
577 $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
578
579crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
580 $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
581
582
583TABLE: Configure
584 (echo 'Output of `Configure TABLE'"':"; \
585 $(PERL) Configure TABLE) > TABLE
586
587update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
588
589# Build distribution tar-file. As the list of files returned by "find" is
590# pretty long, on several platforms a "too many arguments" error or similar
591# would occur. Therefore the list of files is temporarily stored into a file
592# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
593# tar does not support the --files-from option.
594tar:
595 find . -type d -print | xargs chmod 755
596 find . -type f -print | xargs chmod a+r
597 find . -type f -perm -0100 -print | xargs chmod a+x
598 find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
599 $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
600 tardy --user_number=0 --user_name=openssl \
601 --group_number=0 --group_name=openssl \
602 --prefix=openssl-$(VERSION) - |\
603 gzip --best >../$(TARFILE).gz; \
604 rm -f ../$(TARFILE).list; \
605 ls -l ../$(TARFILE).gz
606
607tar-snap:
608 @$(TAR) $(TARFLAGS) -cvf - \
609 `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
610 tardy --user_number=0 --user_name=openssl \
611 --group_number=0 --group_name=openssl \
612 --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
613 ls -l ../$(TARFILE)
614
615dist:
616 $(PERL) Configure dist
617 @$(MAKE) dist_pem_h
618 @$(MAKE) SDIRS='$(SDIRS)' clean
619 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
620
621dist_pem_h:
622 (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
623
624install: all install_docs install_sw
625
626install_sw:
627 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
628 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
629 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
630 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
631 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
632 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
633 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
634 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
635 @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
636 do \
637 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
638 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
639 done;
640 @set -e; target=install; $(RECURSIVE_BUILD_CMD)
641 @set -e; for i in $(LIBS) ;\
642 do \
643 if [ -f "$$i" ]; then \
644 ( echo installing $$i; \
645 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
646 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
647 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
648 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
649 fi; \
650 done;
651 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
652 tmp="$(SHARED_LIBS)"; \
653 for i in $${tmp:-x}; \
654 do \
655 if [ -f "$$i" -o -f "$$i.a" ]; then \
656 ( echo installing $$i; \
657 if [ "$(PLATFORM)" != "Cygwin" ]; then \
658 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
659 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
660 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
661 else \
662 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
663 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
664 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
665 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
666 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
667 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
668 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
669 fi ); \
670 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
671 ( case $$i in \
672 *crypto*) i=libeay32.dll;; \
673 *ssl*) i=ssleay32.dll;; \
674 esac; \
675 echo installing $$i; \
676 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
677 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
678 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
679 fi; \
680 fi; \
681 done; \
682 ( here="`pwd`"; \
683 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
684 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
685 if [ "$(INSTALLTOP)" != "/usr" ]; then \
686 echo 'OpenSSL shared libraries have been installed in:'; \
687 echo ' $(INSTALLTOP)'; \
688 echo ''; \
689 sed -e '1,/^$$/d' doc/openssl-shared.txt; \
690 fi; \
691 fi
692 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
693 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
694 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
695 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
696 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
697 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
698
699install_html_docs:
700 here="`pwd`"; \
701 for subdir in apps crypto ssl; do \
702 mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
703 for i in doc/$$subdir/*.pod; do \
704 fn=`basename $$i .pod`; \
705 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
706 cat $$i \
707 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
708 | pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \
709 | sed -r 's/<!DOCTYPE.*//g' \
710 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
711 $(PERL) util/extract-names.pl < $$i | \
712 grep -v $$filecase "^$$fn\$$" | \
713 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
714 while read n; do \
715 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
716 done); \
717 done; \
718 done
719
720install_docs:
721 @$(PERL) $(TOP)/util/mkdir-p.pl \
722 $(INSTALL_PREFIX)$(MANDIR)/man1 \
723 $(INSTALL_PREFIX)$(MANDIR)/man3 \
724 $(INSTALL_PREFIX)$(MANDIR)/man5 \
725 $(INSTALL_PREFIX)$(MANDIR)/man7
726 @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
727 here="`pwd`"; \
728 filecase=; \
729 if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
730 filecase=-i; \
731 fi; \
732 set -e; for i in doc/apps/*.pod; do \
733 fn=`basename $$i .pod`; \
734 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
735 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
736 (cd `$(PERL) util/dirname.pl $$i`; \
737 sh -c "$$pod2man \
738 --section=$$sec --center=OpenSSL \
739 --release=$(VERSION) `basename $$i`") \
740 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
741 $(PERL) util/extract-names.pl < $$i | \
742 (grep -v $$filecase "^$$fn\$$"; true) | \
743 (grep -v "[ ]"; true) | \
744 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
745 while read n; do \
746 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
747 done); \
748 done; \
749 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
750 fn=`basename $$i .pod`; \
751 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
752 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
753 (cd `$(PERL) util/dirname.pl $$i`; \
754 sh -c "$$pod2man \
755 --section=$$sec --center=OpenSSL \
756 --release=$(VERSION) `basename $$i`") \
757 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
758 $(PERL) util/extract-names.pl < $$i | \
759 (grep -v $$filecase "^$$fn\$$"; true) | \
760 (grep -v "[ ]"; true) | \
761 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
762 while read n; do \
763 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
764 done); \
765 done
766
767# DO NOT DELETE THIS LINE -- make depend depends on it.