]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.org
Apparently s->ctx could be NULL. (Coverity ID 147).
[thirdparty/openssl.git] / Makefile.org
CommitLineData
d56128f0
RE
1##
2## Makefile for OpenSSL
3##
4
0973910f
UM
5VERSION=
6MAJOR=
7MINOR=
b436a982
RL
8SHLIB_VERSION_NUMBER=
9SHLIB_VERSION_HISTORY=
10SHLIB_MAJOR=
11SHLIB_MINOR=
a22fb399 12SHLIB_EXT=
d56128f0 13PLATFORM=dist
31ff97b2 14OPTIONS=
c59cb511 15CONFIGURE_ARGS=
b436a982
RL
16SHLIB_TARGET=
17
30c08f2e
RL
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
e5f3045f
BM
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=
462ba4f6
UM
27INSTALLTOP=/usr/local/ssl
28
29# Do not edit this manually. Use Configure --openssldir=DIR do change this!
30OPENSSLDIR=/usr/local/ssl
d56128f0 31
d02b48c6
RE
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
58964a49 36# system defines as well, i.e. _REENTERANT for Solaris 2.[34]
d02b48c6
RE
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
58964a49
RE
41# one. 32 bytes will be read from this when the random
42# number generator is initalised.
baf748ba 43# SSL_FORBID_ENULL - define if you want the server to be not able to use the
58964a49 44# NULL encryption ciphers.
d02b48c6
RE
45#
46# LOCK_DEBUG - turns on lots of lock debug output :-)
47# REF_CHECK - turn on some xyz_free() assertions.
58964a49 48# REF_PRINT - prints some stuff on structure free.
d02b48c6
RE
49# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
50# MFUNC - Make all Malloc/Free/Realloc calls call
58964a49
RE
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
dfeab068
RE
56# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
57# equal 4.
58# PKCS1_CHECK - pkcs1 tests.
d02b48c6 59
67ea999d
AP
60CC= cc
61CFLAG= -O
f5d7a031 62DEPFLAG=
bc29d0e5 63PEX_LIBS=
651d0aff 64EX_LIBS=
967d95f0 65EXE_EXT=
179add2b
RL
66ARFLAGS=
67AR=ar $(ARFLAGS) r
99aab161 68RANLIB= ranlib
cbfb39d1 69NM= nm
99aab161 70PERL= perl
2dbb3ccd 71TAR= tar
63977104 72TARFLAGS= --no-recursion
cf1b7d96 73MAKEDEPPROG=makedepend
d02b48c6 74
3cc9a89d
AP
75# We let the C compiler driver to take care of .s files. This is done in
76# order to be excused from maintaining a separate set of architecture
77# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
78# gcc, then the driver will automatically translate it to -xarch=v8plus
79# and pass it down to assembler.
80AS=$(CC) -c
01fc834b 81ASFLAG=$(CFLAG)
3cc9a89d 82
14e21f86
AP
83# For x86 assembler: Set PROCESSOR to 386 if you want to support
84# the 80386.
85PROCESSOR=
86
87# CPUID module collects small commonly used assembler snippets
88CPUID_OBJ=
dfeab068 89BN_ASM= bn_asm.o
67ea999d 90DES_ENC= des_enc.o fcrypt_b.o
0ddd3ea2 91AES_ENC= aes_core.o aes_cbc.o
67ea999d
AP
92BF_ENC= bf_enc.o
93CAST_ENC= c_enc.o
94RC4_ENC= rc4_enc.o
95RC5_ENC= rc5_enc.o
96MD5_ASM_OBJ=
97SHA1_ASM_OBJ=
98RMD160_ASM_OBJ=
ed26604a 99WP_ASM_OBJ=
6a8517f2 100CMLL_ENC=
fa8e921f 101PERLASM_SCHEME=
58964a49 102
f9b3bff6
RL
103# KRB5 stuff
104KRB5_INCLUDES=
c1269c81 105LIBKRB5=
f9b3bff6 106
ad2695b1
DSH
107# Zlib stuff
108ZLIB_INCLUDE=
109LIBZLIB=
110
506fec1a 111DIRS= crypto ssl engines apps test tools
0973910f
UM
112SHLIBDIRS= crypto ssl
113
d02b48c6
RE
114# dirs in crypto to build
115SDIRS= \
d87b79bf 116 objects \
d1593e6b 117 md2 md4 md5 sha mdc2 hmac ripemd whrlpool \
5d48a66a 118 des aes rc2 rc4 rc5 idea bf cast camellia seed modes \
67ea999d 119 bn ec rsa dsa ecdsa dh ecdh dso engine \
d87b79bf 120 buffer bio stack lhash rand err \
a5db6fa5 121 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
6caa4edd 122 cms pqueue ts jpake
02c31fa4
AP
123# keep in mind that the above list is adjusted by ./Configure
124# according to no-xxx arguments...
d02b48c6 125
f777408f
RL
126# tests to perform. "alltests" is a special word indicating that all tests
127# should be performed.
128TESTS = alltests
129
42ba5d23 130MAKEFILE= Makefile
d02b48c6 131
e1c55191 132MANDIR=$(OPENSSLDIR)/man
d02b48c6
RE
133MAN1=1
134MAN3=3
1cc087fe 135MANSUFFIX=
60cdb821
UM
136HTMLSUFFIX=html
137HTMLDIR=$(OPENSSLDIR)/html
d02b48c6
RE
138SHELL=/bin/sh
139
58964a49 140TOP= .
d02b48c6 141ONEDIRS=out tmp
7d7d2cbc 142EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
58964a49 143WDIRS= windows
b436a982 144LIBS= libcrypto.a libssl.a
a22fb399
RL
145SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
146SHARED_SSL=libssl$(SHLIB_EXT)
147SHARED_LIBS=
148SHARED_LIBS_LINK_EXTS=
a5595fde 149SHARED_LDFLAGS=
58964a49
RE
150
151GENERAL= Makefile
9ce5db45 152BASENAME= openssl
58964a49
RE
153NAME= $(BASENAME)-$(VERSION)
154TARFILE= $(NAME).tar
155WTARFILE= $(NAME)-win.tar
cf1b7d96 156EXHEADER= e_os2.h
58964a49 157HEADER= e_os.h
d02b48c6 158
0962fbbf 159all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
d02b48c6 160
02c31fa4 161# as we stick to -e, CLEARENV ensures that local variables in lower
a41b0aad
AP
162# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
163# shell, which [annoyingly enough] terminates unset with error if VAR
164# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
165# which terminates unset with error if no variable was present:-(
166CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
02c31fa4
AP
167 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
168 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
169 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
170 $${EXHEADER+EXHEADER} $${HEADER+HEADER} \
171 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
172 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
2f3c39bc
AP
173 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \
174 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
02c31fa4
AP
175 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
176
d0590fe6 177BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
d0590fe6 178 CC='${CC}' CFLAG='${CFLAG}' \
33c3ecf7 179 AS='${CC}' ASFLAG='${CFLAG} -c' \
cbfb39d1 180 AR='${AR}' NM='${NM}' RANLIB='${RANLIB}' \
5b50f99e 181 CROSS_COMPILE_PREFIX='${CROSS_COMPILE_PREFIX}' \
cbfb39d1 182 PERL='${PERL}' \
02c31fa4 183 SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib' \
e9f5428d 184 INSTALL_PREFIX='${INSTALL_PREFIX}' \
7abbffc3 185 INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' \
02c31fa4 186 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
ce92b6eb
AP
187 DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}' \
188 MAKEDEPPROG='${MAKEDEPPROG}' \
2f3c39bc 189 SHARED_LDFLAGS='${SHARED_LDFLAGS}' \
d0590fe6
AP
190 KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' \
191 EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' \
192 SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
193 PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' \
14e21f86 194 CPUID_OBJ='${CPUID_OBJ}' \
d0590fe6 195 BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' \
0ddd3ea2 196 AES_ENC='${AES_ENC}' CMLL_ENC='${CMLL_ENC}' \
d0590fe6
AP
197 BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' \
198 RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' \
199 SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \
200 MD5_ASM_OBJ='${MD5_ASM_OBJ}' \
7abbffc3 201 RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \
ed26604a 202 WP_ASM_OBJ='${WP_ASM_OBJ}' \
fa8e921f 203 PERLASM_SCHEME='${PERLASM_SCHEME}' \
02c31fa4
AP
204 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
205# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
206# which in turn eliminates ambiguities in variable treatment with -e.
d0590fe6 207
b480283c
RL
208# BUILD_CMD is a generic macro to build a given target in a given
209# subdirectory. The target must be given through the shell variable
210# `target' and the subdirectory to build in must be given through `dir'.
211# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
212# BUILD_ONE_CMD instead.
213#
214# BUILD_ONE_CMD is a macro to build a given target in a given
215# subdirectory if that subdirectory is part of $(DIRS). It requires
216# exactly the same shell variables as BUILD_CMD.
217#
218# RECURSIVE_BUILD_CMD is a macro to build a given target in all
219# subdirectories defined in $(DIRS). It requires that the target
220# is given through the shell variable `target'.
02c31fa4
AP
221BUILD_CMD= if [ -d "$$dir" ]; then \
222 ( cd $$dir && echo "making $$target in $$dir..." && \
223 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
224 ) || exit 1; \
225 fi
226RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
f5ce5e14
RL
227BUILD_ONE_CMD=\
228 if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
229 $(BUILD_CMD); \
230 fi
88c80b3e 231
734540f8 232reflect:
02c31fa4 233 @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
734540f8 234
4c82171a 235sub_all: build_all
88c80b3e
RL
236build_all: build_libs build_apps build_tests build_tools
237
506fec1a 238build_libs: build_crypto build_ssl build_engines
88c80b3e
RL
239
240build_crypto:
f5ce5e14 241 @dir=crypto; target=all; $(BUILD_ONE_CMD)
88c80b3e 242build_ssl:
f5ce5e14 243 @dir=ssl; target=all; $(BUILD_ONE_CMD)
506fec1a 244build_engines:
f5ce5e14 245 @dir=engines; target=all; $(BUILD_ONE_CMD)
88c80b3e 246build_apps:
f5ce5e14 247 @dir=apps; target=all; $(BUILD_ONE_CMD)
88c80b3e 248build_tests:
f5ce5e14 249 @dir=test; target=all; $(BUILD_ONE_CMD)
88c80b3e 250build_tools:
f5ce5e14 251 @dir=tools; target=all; $(BUILD_ONE_CMD)
ba5477eb
RL
252
253all_testapps: build_libs build_testapps
254build_testapps:
f5ce5e14 255 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
b436a982 256
a22fb399 257libcrypto$(SHLIB_EXT): libcrypto.a
f4316c36 258 @if [ "$(SHLIB_TARGET)" != "" ]; then \
a22fb399 259 $(MAKE) SHLIBDIRS=crypto build-shared; \
f4316c36
RL
260 else \
261 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 262 exit 1; \
f4316c36 263 fi
0f180d1d 264
a22fb399 265libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
f4316c36 266 @if [ "$(SHLIB_TARGET)" != "" ]; then \
5ddcb866 267 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
f4316c36
RL
268 else \
269 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 270 exit 1; \
f4316c36 271 fi
b436a982
RL
272
273clean-shared:
cfd06a62 274 @set -e; for i in $(SHLIBDIRS); do \
a22fb399
RL
275 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
276 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
277 for j in $${tmp:-x}; do \
278 ( set -x; rm -f lib$$i$$j ); \
279 done; \
280 fi; \
281 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
49e04548 282 if [ "$(PLATFORM)" = "Cygwin" ]; then \
1fe198b6
RL
283 ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
284 fi; \
b436a982 285 done
d02b48c6 286
a22fb399 287link-shared:
cfd06a62 288 @ set -e; for i in ${SHLIBDIRS}; do \
755c5b33 289 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
30afcc07
RL
290 LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
291 LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
292 symlink.$(SHLIB_TARGET); \
6b86bad5 293 libs="$$libs -l$$i"; \
0fd44e2d
RL
294 done
295
30afcc07
RL
296build-shared: do_$(SHLIB_TARGET) link-shared
297
298do_$(SHLIB_TARGET):
cfd06a62 299 @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
c1269c81
RL
300 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
301 libs="$(LIBKRB5) $$libs"; \
302 fi; \
02c31fa4 303 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
30afcc07
RL
304 LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
305 LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
306 LIBDEPS="$$libs $(EX_LIBS)" \
307 link_a.$(SHLIB_TARGET); \
c1269c81 308 libs="-l$$i $$libs"; \
a3fffd64
RL
309 done
310
0962fbbf
RL
311libcrypto.pc: Makefile
312 @ ( echo 'prefix=$(INSTALLTOP)'; \
313 echo 'exec_prefix=$${prefix}'; \
314 echo 'libdir=$${exec_prefix}/lib'; \
315 echo 'includedir=$${prefix}/include'; \
316 echo ''; \
317 echo 'Name: OpenSSL-libcrypto'; \
318 echo 'Description: OpenSSL cryptography library'; \
319 echo 'Version: '$(VERSION); \
320 echo 'Requires: '; \
321 echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
322 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
323
324libssl.pc: Makefile
325 @ ( echo 'prefix=$(INSTALLTOP)'; \
326 echo 'exec_prefix=$${prefix}'; \
327 echo 'libdir=$${exec_prefix}/lib'; \
328 echo 'includedir=$${prefix}/include'; \
329 echo ''; \
330 echo 'Name: OpenSSL'; \
331 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
332 echo 'Version: '$(VERSION); \
333 echo 'Requires: '; \
334 echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
335 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
336
42ba5d23 337openssl.pc: Makefile
56824b96
RL
338 @ ( echo 'prefix=$(INSTALLTOP)'; \
339 echo 'exec_prefix=$${prefix}'; \
340 echo 'libdir=$${exec_prefix}/lib'; \
341 echo 'includedir=$${prefix}/include'; \
342 echo ''; \
343 echo 'Name: OpenSSL'; \
344 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
345 echo 'Version: '$(VERSION); \
346 echo 'Requires: '; \
347 echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
49be7042 348 echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
56824b96 349
c7199e62
BL
350Makefile: Makefile.org Configure config
351 @echo "Makefile is older than Makefile.org, Configure or config."
49b81422 352 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
9535d202
BL
353 @false
354
dfeab068 355libclean:
447aa490 356 rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
dfeab068 357
7841edc9
RL
358clean: libclean
359 rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
02c31fa4
AP
360 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
361 rm -f $(LIBS)
0962fbbf 362 rm -f openssl.pc libssl.pc libcrypto.pc
7841edc9 363 rm -f speed.* .pure
bb8f3c58 364 rm -f $(TARFILE)
cfd06a62 365 @set -e; for i in $(ONEDIRS) ;\
d02b48c6 366 do \
bb8f3c58 367 rm -fr $$i/*; \
d02b48c6
RE
368 done
369
370makefile.one: files
99aab161 371 $(PERL) util/mk1mf.pl >makefile.one; \
d02b48c6
RE
372 sh util/do_ms.sh
373
bacad008 374files:
42ba5d23 375 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
02c31fa4 376 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
d02b48c6
RE
377
378links:
6576774b 379 @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
41d2a336 380 @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
02c31fa4 381 @set -e; target=links; $(RECURSIVE_BUILD_CMD)
d02b48c6 382
1cc67fa8
RL
383gentests:
384 @(cd test && echo "generating dummy tests (if needed)..." && \
02c31fa4 385 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
1cc67fa8 386
d02b48c6 387dclean:
95553390 388 rm -rf *.bak include/openssl certs/.0
02c31fa4 389 @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
d02b48c6 390
e6e7b5f3 391rehash: rehash.time
cbfb39d1
AP
392rehash.time: certs apps
393 @if [ -z "$(CROSS_COMPILE_PREFIX)" ]; then \
394 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
6d0624ac 395 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
cbfb39d1
AP
396 OPENSSL_DEBUG_MEMORY=on; \
397 export OPENSSL OPENSSL_DEBUG_MEMORY; \
398 $(PERL) tools/c_rehash certs) && \
399 touch rehash.time; \
400 else :; fi
d02b48c6 401
58964a49 402test: tests
d02b48c6 403
73bfb9ad 404tests: rehash
bb8f3c58 405 @(cd test && echo "testing..." && \
02c31fa4 406 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
62d27939 407 util/opensslwrap.sh version -a
d02b48c6 408
d7f0ab5f
UM
409report:
410 @$(PERL) util/selftest.pl
411
d02b48c6 412depend:
02c31fa4 413 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
d02b48c6
RE
414
415lint:
02c31fa4 416 @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
d02b48c6
RE
417
418tags:
a273a282
BL
419 rm -f TAGS
420 find . -name '[^.]*.[ch]' | xargs etags -a
d02b48c6
RE
421
422errors:
f6485909 423 $(PERL) util/mkerr.pl -recurse -write
506fec1a 424 (cd engines; $(MAKE) PERL=$(PERL) errors)
fbeaa3c4 425 $(PERL) util/ck_errf.pl */*.c */*/*.c
d02b48c6 426
a6fbcb42
DSH
427stacks:
428 $(PERL) util/mkstack.pl -write
429
7740a1c6 430util/libeay.num::
f6485909 431 $(PERL) util/mkdef.pl crypto update
7740a1c6
BM
432
433util/ssleay.num::
f6485909 434 $(PERL) util/mkdef.pl ssl update
7740a1c6 435
1d00800e 436crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
f6485909 437 $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
0357422d 438crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
f6485909 439 $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
a19c9f17
RL
440crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
441 $(PERL) crypto/objects/objxref.pl > crypto/objects/obj_xref.h
49e747e6 442
2faa930b
RL
443apps/openssl-vms.cnf: apps/openssl.cnf
444 $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
445
11cd2397
RL
446crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
447 $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
448
449
62c419d6 450TABLE: Configure
2330e18b 451 (echo 'Output of `Configure TABLE'"':"; \
f6485909 452 $(PERL) Configure TABLE) > TABLE
7740a1c6 453
a6fbcb42 454update: 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
7740a1c6 455
f9de8446
LJ
456# Build distribution tar-file. As the list of files returned by "find" is
457# pretty long, on several platforms a "too many arguments" error or similar
458# would occur. Therefore the list of files is temporarily stored into a file
459# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
460# tar does not support the --files-from option.
d02b48c6 461tar:
756b9a00
LJ
462 find . -type d -print | xargs chmod 755
463 find . -type f -print | xargs chmod a+r
464 find . -type f -perm -0100 -print | xargs chmod a+x
f9de8446
LJ
465 find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
466 $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
5a061129 467 tardy --user_number=0 --user_name=openssl \
9ce5db45
RE
468 --group_number=0 --group_name=openssl \
469 --prefix=openssl-$(VERSION) - |\
651d0aff 470 gzip --best >../$(TARFILE).gz; \
f9de8446 471 rm -f ../$(TARFILE).list; \
651d0aff 472 ls -l ../$(TARFILE).gz
d02b48c6 473
41d2a336
RL
474tar-snap:
475 @$(TAR) $(TARFLAGS) -cvf - \
3a7cef3e 476 `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` |\
41d2a336
RL
477 tardy --user_number=0 --user_name=openssl \
478 --group_number=0 --group_name=openssl \
479 --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
480 ls -l ../$(TARFILE)
481
58964a49 482dist:
99aab161 483 $(PERL) Configure dist
d02b48c6
RE
484 @$(MAKE) dist_pem_h
485 @$(MAKE) SDIRS='${SDIRS}' clean
870d3d55 486 @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
d02b48c6
RE
487
488dist_pem_h:
02c31fa4 489 (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
d02b48c6 490
28a80034
RL
491install: all install_docs install_sw
492
493install_sw:
f0588887
BM
494 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
495 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
90819805 496 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
9d5c42b6 497 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
f0588887
BM
498 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
499 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
500 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
8d472bdd 501 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
a2ac429d 502 @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
2a4a0a34
BM
503 do \
504 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
505 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
506 done;
02c31fa4 507 @set -e; target=install; $(RECURSIVE_BUILD_CMD)
cfd06a62 508 @set -e; for i in $(LIBS) ;\
d02b48c6 509 do \
b436a982
RL
510 if [ -f "$$i" ]; then \
511 ( echo installing $$i; \
7104c376
RL
512 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
513 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
514 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
30c08f2e 515 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
2c975b50
LJ
516 fi; \
517 done;
cfd06a62 518 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
a22fb399
RL
519 tmp="$(SHARED_LIBS)"; \
520 for i in $${tmp:-x}; \
521 do \
1fe198b6 522 if [ -f "$$i" -o -f "$$i.a" ]; then \
a22fb399 523 ( echo installing $$i; \
49e04548 524 if [ "$(PLATFORM)" != "Cygwin" ]; then \
7104c376
RL
525 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
526 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
30c08f2e 527 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
1fe198b6 528 else \
447aa490 529 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
7104c376
RL
530 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
531 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
30c08f2e 532 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
447aa490
RL
533 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
534 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
535 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
1fe198b6 536 fi ); \
4c1a6e00
LJ
537 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
538 ( case $$i in \
539 *crypto*) i=libeay32.dll;; \
540 *ssl*) i=ssleay32.dll;; \
541 esac; \
542 echo installing $$i; \
543 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
544 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
545 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
546 fi; \
2c975b50 547 fi; \
a22fb399
RL
548 done; \
549 ( here="`pwd`"; \
550 cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
4c3a2d64 551 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
e68cb95d
RL
552 if [ "$(INSTALLTOP)" != "/usr" ]; then \
553 echo 'OpenSSL shared libraries have been installed in:'; \
554 echo ' $(INSTALLTOP)'; \
555 echo ''; \
c0cc5c30 556 sed -e '1,/^$$/d' doc/openssl-shared.txt; \
e68cb95d 557 fi; \
a22fb399 558 fi
0962fbbf
RL
559 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
560 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libcrypto.pc
561 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
562 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libssl.pc
8e7a8b68 563 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
eeff6bb6 564 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
e6e7b5f3 565
60cdb821
UM
566install_html_docs:
567 here="`pwd`"; \
568 for subdir in apps crypto ssl; do \
569 mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
570 for i in doc/$$subdir/*.pod; do \
571 fn=`basename $$i .pod`; \
572 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
573 cat $$i \
574 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
575 | pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \
576 | sed -r 's/<!DOCTYPE.*//g' \
577 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
578 $(PERL) util/extract-names.pl < $$i | \
579 grep -v $$filecase "^$$fn\$$" | \
580 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
581 while read n; do \
582 $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
583 done); \
584 done; \
585 done
586
e6e7b5f3
BM
587install_docs:
588 @$(PERL) $(TOP)/util/mkdir-p.pl \
e1c55191
UM
589 $(INSTALL_PREFIX)$(MANDIR)/man1 \
590 $(INSTALL_PREFIX)$(MANDIR)/man3 \
591 $(INSTALL_PREFIX)$(MANDIR)/man5 \
592 $(INSTALL_PREFIX)$(MANDIR)/man7
623e9e66 593 @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
ec9f67f6
RL
594 here="`pwd`"; \
595 filecase=; \
94c1672e 596 if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
ec9f67f6
RL
597 filecase=-i; \
598 fi; \
cfd06a62 599 set -e; for i in doc/apps/*.pod; do \
c6ce792f 600 fn=`basename $$i .pod`; \
401ee37a 601 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
1cc087fe 602 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 603 (cd `$(PERL) util/dirname.pl $$i`; \
623e9e66 604 sh -c "$$pod2man \
2962243d
RL
605 --section=$$sec --center=OpenSSL \
606 --release=$(VERSION) `basename $$i`") \
1cc087fe 607 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 608 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
609 (grep -v $$filecase "^$$fn\$$"; true) | \
610 (grep -v "[ ]"; true) | \
ec9f67f6
RL
611 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
612 while read n; do \
49096719 613 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 614 done); \
f6f99618 615 done; \
cfd06a62 616 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
c6ce792f 617 fn=`basename $$i .pod`; \
401ee37a 618 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
1cc087fe 619 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 620 (cd `$(PERL) util/dirname.pl $$i`; \
623e9e66 621 sh -c "$$pod2man \
2962243d
RL
622 --section=$$sec --center=OpenSSL \
623 --release=$(VERSION) `basename $$i`") \
1cc087fe 624 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 625 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
626 (grep -v $$filecase "^$$fn\$$"; true) | \
627 (grep -v "[ ]"; true) | \
ec9f67f6
RL
628 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
629 while read n; do \
49096719 630 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 631 done); \
c6ce792f 632 done
d02b48c6
RE
633
634# DO NOT DELETE THIS LINE -- make depend depends on it.