]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.org
rsaz_exp.h: align license with the rest of the contribution
[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
9405a9a2
RS
71#RM= echo --
72RM= rm -f
2dbb3ccd 73TAR= tar
63977104 74TARFLAGS= --no-recursion
cf1b7d96 75MAKEDEPPROG=makedepend
6727565a 76LIBDIR=lib
d02b48c6 77
3cc9a89d
AP
78# We let the C compiler driver to take care of .s files. This is done in
79# order to be excused from maintaining a separate set of architecture
80# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
81# gcc, then the driver will automatically translate it to -xarch=v8plus
82# and pass it down to assembler.
f072785e 83AS=$(CC) -c
01fc834b 84ASFLAG=$(CFLAG)
3cc9a89d 85
14e21f86
AP
86# For x86 assembler: Set PROCESSOR to 386 if you want to support
87# the 80386.
88PROCESSOR=
89
90# CPUID module collects small commonly used assembler snippets
91CPUID_OBJ=
dfeab068 92BN_ASM= bn_asm.o
6019cdd3 93EC_ASM=
67ea999d 94DES_ENC= des_enc.o fcrypt_b.o
0ddd3ea2 95AES_ENC= aes_core.o aes_cbc.o
67ea999d
AP
96BF_ENC= bf_enc.o
97CAST_ENC= c_enc.o
98RC4_ENC= rc4_enc.o
99RC5_ENC= rc5_enc.o
100MD5_ASM_OBJ=
101SHA1_ASM_OBJ=
102RMD160_ASM_OBJ=
ed26604a 103WP_ASM_OBJ=
6a8517f2 104CMLL_ENC=
8a1c92ce 105MODES_ASM_OBJ=
ed28aef8 106ENGINES_ASM_OBJ=
fa8e921f 107PERLASM_SCHEME=
58964a49 108
ad2695b1
DSH
109# Zlib stuff
110ZLIB_INCLUDE=
111LIBZLIB=
112
1ab2f7f1
DSH
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
5084af28 117# $(INSTALLTOP) for this build may be different so hard
1ab2f7f1
DSH
118# code the path.
119
120FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
121
1ab2f7f1 122# The location of the library which contains fipscanister.o
f072785e
DSH
123# normally it will be libcrypto. If not compiling in FIPS mode
124# at all this is empty making it a useful test for a FIPS compile.
1ab2f7f1
DSH
125
126FIPSCANLIB=
127
128# Shared library base address. Currently only used on Windows.
129#
130
131BASEADDR=
132
71a5f534 133DIRS= crypto ssl engines apps test tools
ef236ec3 134ENGDIRS= ccgost
0973910f 135SHLIBDIRS= crypto ssl
dee502be 136INSTALL_SUBS= engines apps tools
0973910f 137
d02b48c6
RE
138# dirs in crypto to build
139SDIRS= \
d87b79bf 140 objects \
d1593e6b 141 md2 md4 md5 sha mdc2 hmac ripemd whrlpool \
5d48a66a 142 des aes rc2 rc4 rc5 idea bf cast camellia seed modes \
67ea999d 143 bn ec rsa dsa ecdsa dh ecdh dso engine \
d87b79bf 144 buffer bio stack lhash rand err \
60b3d36d 145 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui \
edc032b5 146 cms pqueue ts jpake srp store cmac
02c31fa4
AP
147# keep in mind that the above list is adjusted by ./Configure
148# according to no-xxx arguments...
d02b48c6 149
f777408f
RL
150# tests to perform. "alltests" is a special word indicating that all tests
151# should be performed.
152TESTS = alltests
153
42ba5d23 154MAKEFILE= Makefile
d02b48c6 155
e1c55191 156MANDIR=$(OPENSSLDIR)/man
d02b48c6
RE
157MAN1=1
158MAN3=3
1cc087fe 159MANSUFFIX=
60cdb821
UM
160HTMLSUFFIX=html
161HTMLDIR=$(OPENSSLDIR)/html
d02b48c6
RE
162SHELL=/bin/sh
163
58964a49 164TOP= .
b436a982 165LIBS= libcrypto.a libssl.a
a22fb399
RL
166SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
167SHARED_SSL=libssl$(SHLIB_EXT)
168SHARED_LIBS=
169SHARED_LIBS_LINK_EXTS=
a5595fde 170SHARED_LDFLAGS=
58964a49
RE
171
172GENERAL= Makefile
9ce5db45 173BASENAME= openssl
58964a49
RE
174NAME= $(BASENAME)-$(VERSION)
175TARFILE= $(NAME).tar
176WTARFILE= $(NAME)-win.tar
58964a49 177HEADER= e_os.h
d02b48c6 178
9405a9a2
RS
179# Directories created on install if they don't exist.
180INSTALLDIRS= \
181 $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
182 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
183 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
184 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
185 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
186 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
187 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
188 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
189
177b5f9c 190all: Makefile build_all
d02b48c6 191
02c31fa4 192# as we stick to -e, CLEARENV ensures that local variables in lower
a41b0aad
AP
193# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
194# shell, which [annoyingly enough] terminates unset with error if VAR
195# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
196# which terminates unset with error if no variable was present:-(
197CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
02c31fa4
AP
198 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
199 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
200 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
a80e33b9 201 $${HEADER+HEADER} \
02c31fa4
AP
202 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
203 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
dce1cc2a 204 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
2f3c39bc 205 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
02c31fa4
AP
206 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
207
a370537b
AP
208BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
209 CC='$(CC)' CFLAG='$(CFLAG)' \
f072785e 210 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
a370537b 211 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
34775923 212 CROSS_COMPILE='$(CROSS_COMPILE)' \
ef236ec3 213 PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
6727565a 214 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
a370537b
AP
215 INSTALL_PREFIX='$(INSTALL_PREFIX)' \
216 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
19c5314f 217 LIBDIR='$(LIBDIR)' \
a370537b
AP
218 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
219 DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
220 MAKEDEPPROG='$(MAKEDEPPROG)' \
221 SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
cc7399e7 222 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
a370537b
AP
223 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
224 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
225 PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
6019cdd3 226 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
9405a9a2 227 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
a370537b
AP
228 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
229 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
230 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
231 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
232 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
233 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
234 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
8a1c92ce 235 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
ed28aef8 236 ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \
a370537b 237 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
1ab2f7f1
DSH
238 FIPSLIBDIR='${FIPSLIBDIR}' \
239 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
02c31fa4
AP
240 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
241# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
242# which in turn eliminates ambiguities in variable treatment with -e.
d0590fe6 243
b480283c
RL
244# BUILD_CMD is a generic macro to build a given target in a given
245# subdirectory. The target must be given through the shell variable
246# `target' and the subdirectory to build in must be given through `dir'.
247# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
248# BUILD_ONE_CMD instead.
249#
b480283c
RL
250# RECURSIVE_BUILD_CMD is a macro to build a given target in all
251# subdirectories defined in $(DIRS). It requires that the target
252# is given through the shell variable `target'.
9405a9a2
RS
253#
254# BUILD_ONE_CMD is a macro to build a given target in a given
255# subdirectory if that subdirectory is part of $(DIRS). It requires
256# exactly the same shell variables as BUILD_CMD.
02c31fa4
AP
257BUILD_CMD= if [ -d "$$dir" ]; then \
258 ( cd $$dir && echo "making $$target in $$dir..." && \
259 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
260 ) || exit 1; \
261 fi
262RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
f5ce5e14 263BUILD_ONE_CMD=\
b3b201b6 264 if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
f5ce5e14
RL
265 $(BUILD_CMD); \
266 fi
88c80b3e 267
734540f8 268reflect:
02c31fa4 269 @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
734540f8 270
4c82171a 271sub_all: build_all
c3f22253 272
88c80b3e
RL
273build_all: build_libs build_apps build_tests build_tools
274
177b5f9c
RL
275build_libs: build_libcrypto build_libssl openssl.pc
276
277build_libcrypto: build_crypto build_engines libcrypto.pc
278build_libssl: build_ssl libssl.pc
88c80b3e
RL
279
280build_crypto:
f072785e 281 @dir=crypto; target=all; $(BUILD_ONE_CMD)
c3f22253 282build_ssl: build_crypto
f5ce5e14 283 @dir=ssl; target=all; $(BUILD_ONE_CMD)
c3f22253 284build_engines: build_crypto
ed28aef8 285 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
c3f22253
RS
286
287build_apps: build_libs
f5ce5e14 288 @dir=apps; target=all; $(BUILD_ONE_CMD)
c3f22253 289build_tests: build_libs
f5ce5e14 290 @dir=test; target=all; $(BUILD_ONE_CMD)
c3f22253 291build_tools: build_libs
f5ce5e14 292 @dir=tools; target=all; $(BUILD_ONE_CMD)
ba5477eb
RL
293
294all_testapps: build_libs build_testapps
295build_testapps:
f5ce5e14 296 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
b436a982 297
f072785e 298libcrypto$(SHLIB_EXT): libcrypto.a
f4316c36 299 @if [ "$(SHLIB_TARGET)" != "" ]; then \
225c2721
DSH
300 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
301 FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
302 export CC FIPSLD_CC; \
303 fi; \
24e20db4 304 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \
f4316c36
RL
305 else \
306 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 307 exit 1; \
f4316c36 308 fi
0f180d1d 309
a22fb399 310libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
f4316c36 311 @if [ "$(SHLIB_TARGET)" != "" ]; then \
5ddcb866 312 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
f4316c36
RL
313 else \
314 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 315 exit 1; \
f4316c36 316 fi
b436a982
RL
317
318clean-shared:
cfd06a62 319 @set -e; for i in $(SHLIBDIRS); do \
a22fb399
RL
320 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
321 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
322 for j in $${tmp:-x}; do \
323 ( set -x; rm -f lib$$i$$j ); \
324 done; \
325 fi; \
326 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
b3ef742c 327 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
1fe198b6
RL
328 ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
329 fi; \
b436a982 330 done
d02b48c6 331
a22fb399 332link-shared:
a370537b 333 @ set -e; for i in $(SHLIBDIRS); do \
755c5b33 334 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
a370537b
AP
335 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
336 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07 337 symlink.$(SHLIB_TARGET); \
6b86bad5 338 libs="$$libs -l$$i"; \
0fd44e2d
RL
339 done
340
30afcc07
RL
341build-shared: do_$(SHLIB_TARGET) link-shared
342
343do_$(SHLIB_TARGET):
a370537b 344 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
02c31fa4 345 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
a370537b
AP
346 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
347 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07
RL
348 LIBDEPS="$$libs $(EX_LIBS)" \
349 link_a.$(SHLIB_TARGET); \
c1269c81 350 libs="-l$$i $$libs"; \
a3fffd64
RL
351 done
352
0962fbbf
RL
353libcrypto.pc: Makefile
354 @ ( echo 'prefix=$(INSTALLTOP)'; \
355 echo 'exec_prefix=$${prefix}'; \
6727565a 356 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
357 echo 'includedir=$${prefix}/include'; \
358 echo ''; \
359 echo 'Name: OpenSSL-libcrypto'; \
360 echo 'Description: OpenSSL cryptography library'; \
361 echo 'Version: '$(VERSION); \
362 echo 'Requires: '; \
04296664
DSH
363 echo 'Libs: -L$${libdir} -lcrypto'; \
364 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 365 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
0962fbbf
RL
366
367libssl.pc: Makefile
368 @ ( echo 'prefix=$(INSTALLTOP)'; \
369 echo 'exec_prefix=$${prefix}'; \
6727565a 370 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
371 echo 'includedir=$${prefix}/include'; \
372 echo ''; \
e6479c76 373 echo 'Name: OpenSSL-libssl'; \
0962fbbf
RL
374 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
375 echo 'Version: '$(VERSION); \
e6479c76
MF
376 echo 'Requires.private: libcrypto'; \
377 echo 'Libs: -L$${libdir} -lssl'; \
04296664 378 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 379 echo 'Cflags: -I$${includedir}' ) > libssl.pc
0962fbbf 380
42ba5d23 381openssl.pc: Makefile
56824b96
RL
382 @ ( echo 'prefix=$(INSTALLTOP)'; \
383 echo 'exec_prefix=$${prefix}'; \
6727565a 384 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
56824b96
RL
385 echo 'includedir=$${prefix}/include'; \
386 echo ''; \
387 echo 'Name: OpenSSL'; \
388 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
389 echo 'Version: '$(VERSION); \
e6479c76 390 echo 'Requires: libssl libcrypto' ) > openssl.pc
56824b96 391
c7199e62
BL
392Makefile: Makefile.org Configure config
393 @echo "Makefile is older than Makefile.org, Configure or config."
49b81422 394 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
9535d202
BL
395 @false
396
dfeab068 397libclean:
acb2f06a 398 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
dfeab068 399
7841edc9 400clean: libclean
9598996c 401 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
56999ba5 402 rm -rf *.bak certs/.0
02c31fa4 403 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
34ccd24d 404 rm -f $(LIBS) tags TAGS
0962fbbf 405 rm -f openssl.pc libssl.pc libcrypto.pc
7841edc9 406 rm -f speed.* .pure
bb8f3c58 407 rm -f $(TARFILE)
d02b48c6
RE
408
409makefile.one: files
99aab161 410 $(PERL) util/mk1mf.pl >makefile.one; \
d02b48c6
RE
411 sh util/do_ms.sh
412
bacad008 413files:
42ba5d23 414 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
02c31fa4 415 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
d02b48c6 416
1cc67fa8
RL
417gentests:
418 @(cd test && echo "generating dummy tests (if needed)..." && \
a370537b 419 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
1cc67fa8 420
d02b48c6 421dclean:
02c31fa4 422 @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
d02b48c6 423
0431941e
DSH
424rehash: rehash.time
425rehash.time: certs apps
34775923 426 @if [ -z "$(CROSS_COMPILE)" ]; then \
0431941e
DSH
427 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
428 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
bea6cd3e
RS
429 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
430 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
fefc111a 431 $(PERL) tools/c_rehash certs/demo) && \
0431941e
DSH
432 touch rehash.time; \
433 else :; fi
434
58964a49 435test: tests
d02b48c6 436
0431941e 437tests: rehash
bb8f3c58 438 @(cd test && echo "testing..." && \
220bd849
DSH
439 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
440 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
d02b48c6 441
d7f0ab5f
UM
442report:
443 @$(PERL) util/selftest.pl
444
6f45032f 445update: errors stacks util/libeay.num util/ssleay.num TABLE
0f539dc1
RL
446 @set -e; target=update; $(RECURSIVE_BUILD_CMD)
447
d02b48c6 448depend:
02c31fa4 449 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
d02b48c6
RE
450
451lint:
02c31fa4 452 @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
d02b48c6 453
34ccd24d
RS
454tags TAGS: FORCE
455 rm -f TAGS tags
456 -ctags -R .
457 -etags -R .
458
459FORCE:
d02b48c6
RE
460
461errors:
797c61aa 462 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
f6485909 463 $(PERL) util/mkerr.pl -recurse -write
506fec1a 464 (cd engines; $(MAKE) PERL=$(PERL) errors)
d02b48c6 465
a6fbcb42
DSH
466stacks:
467 $(PERL) util/mkstack.pl -write
468
7740a1c6 469util/libeay.num::
f6485909 470 $(PERL) util/mkdef.pl crypto update
7740a1c6
BM
471
472util/ssleay.num::
f6485909 473 $(PERL) util/mkdef.pl ssl update
7740a1c6 474
97a0cc52 475TABLE: Configure Configurations/*.conf
2330e18b 476 (echo 'Output of `Configure TABLE'"':"; \
f6485909 477 $(PERL) Configure TABLE) > TABLE
7740a1c6 478
f9de8446
LJ
479# Build distribution tar-file. As the list of files returned by "find" is
480# pretty long, on several platforms a "too many arguments" error or similar
481# would occur. Therefore the list of files is temporarily stored into a file
482# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
483# tar does not support the --files-from option.
27f98436 484TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
da24e6f8 485 --owner openssl:0 --group openssl:0 \
27f98436
RL
486 --transform 's|^|openssl-$(VERSION)/|' \
487 -cvf -
488
489../$(TARFILE).list:
490 find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
491 \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
492 \! -name '*test' \! -name '.#*' \! -name '*~' \
493 | sort > ../$(TARFILE).list
494
495tar: ../$(TARFILE).list
756b9a00
LJ
496 find . -type d -print | xargs chmod 755
497 find . -type f -print | xargs chmod a+r
498 find . -type f -perm -0100 -print | xargs chmod a+x
27f98436
RL
499 $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
500 rm -f ../$(TARFILE).list
651d0aff 501 ls -l ../$(TARFILE).gz
d02b48c6 502
27f98436
RL
503tar-snap: ../$(TARFILE).list
504 $(TAR_COMMAND) > ../$(TARFILE)
505 rm -f ../$(TARFILE).list
41d2a336
RL
506 ls -l ../$(TARFILE)
507
58964a49 508dist:
99aab161 509 $(PERL) Configure dist
d02b48c6 510 @$(MAKE) dist_pem_h
a370537b
AP
511 @$(MAKE) SDIRS='$(SDIRS)' clean
512 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
d02b48c6
RE
513
514dist_pem_h:
02c31fa4 515 (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
d02b48c6 516
28a80034
RL
517install: all install_docs install_sw
518
9405a9a2
RS
519uninstall: uninstall_sw uninstall_docs
520
28a80034 521install_sw:
9405a9a2 522 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
dee502be
RL
523 @set -e; for i in include/openssl/*.h; do \
524 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
525 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
2a4a0a34 526 done;
dee502be 527 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
d341e402 528 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
d02b48c6 529 do \
b436a982
RL
530 if [ -f "$$i" ]; then \
531 ( echo installing $$i; \
6727565a
DSH
532 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
533 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
534 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
535 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
2c975b50
LJ
536 fi; \
537 done;
cfd06a62 538 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
a22fb399
RL
539 tmp="$(SHARED_LIBS)"; \
540 for i in $${tmp:-x}; \
541 do \
1fe198b6 542 if [ -f "$$i" -o -f "$$i.a" ]; then \
a22fb399 543 ( echo installing $$i; \
65370f9b 544 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
447aa490 545 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
7104c376
RL
546 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
547 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
30c08f2e 548 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
6727565a
DSH
549 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
550 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
551 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
65370f9b
AP
552 else \
553 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
554 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
555 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
1fe198b6 556 fi ); \
4c1a6e00
LJ
557 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
558 ( case $$i in \
559 *crypto*) i=libeay32.dll;; \
560 *ssl*) i=ssleay32.dll;; \
561 esac; \
562 echo installing $$i; \
9405a9a2
RS
563 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
564 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
565 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
4c1a6e00 566 fi; \
2c975b50 567 fi; \
a22fb399
RL
568 done; \
569 ( here="`pwd`"; \
72a9776a 570 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
4c3a2d64 571 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
e68cb95d
RL
572 if [ "$(INSTALLTOP)" != "/usr" ]; then \
573 echo 'OpenSSL shared libraries have been installed in:'; \
574 echo ' $(INSTALLTOP)'; \
e68cb95d 575 fi; \
a22fb399 576 fi
6727565a
DSH
577 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
578 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
579 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
580 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
581 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
582 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
e6e7b5f3 583
9405a9a2
RS
584uninstall_sw:
585 cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
586 @for i in $(LIBS) ;\
587 do \
588 test -f "$$i" && \
589 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
590 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
591 done;
592 @if [ -n "$(SHARED_LIBS)" ]; then \
593 tmp="$(SHARED_LIBS)"; \
594 for i in $${tmp:-x}; \
595 do \
596 if [ -f "$$i" -o -f "$$i.a" ]; then \
597 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
598 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
599 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
600 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
601 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
602 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
603 else \
604 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
605 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
606 fi; \
607 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
608 case $$i in \
609 *crypto*) i=libeay32.dll;; \
610 *ssl*) i=ssleay32.dll;; \
611 esac; \
612 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
613 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
614 fi; \
615 fi; \
616 done; \
617 fi
618 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
619 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
620 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
621 @target=uninstall; $(RECURSIVE_BUILD_CMD)
622
60cdb821
UM
623install_html_docs:
624 here="`pwd`"; \
82d9185a 625 filecase=; \
457f7b14 626 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
82d9185a
JR
627 filecase=-i; \
628 esac; \
60cdb821 629 for subdir in apps crypto ssl; do \
9405a9a2 630 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
60cdb821
UM
631 for i in doc/$$subdir/*.pod; do \
632 fn=`basename $$i .pod`; \
633 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
634 cat $$i \
635 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
690a2b1f 636 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
60cdb821
UM
637 | sed -r 's/<!DOCTYPE.*//g' \
638 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
639 $(PERL) util/extract-names.pl < $$i | \
640 grep -v $$filecase "^$$fn\$$" | \
641 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
642 while read n; do \
220bd849 643 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
60cdb821
UM
644 done); \
645 done; \
646 done
647
9405a9a2
RS
648uninstall_html_docs:
649 here="`pwd`"; \
650 filecase=; \
651 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
652 filecase=-i; \
653 esac; \
654 for subdir in apps crypto ssl; do \
655 for i in doc/$$subdir/*.pod; do \
656 fn=`basename $$i .pod`; \
657 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
658 $(PERL) util/extract-names.pl < $$i | \
659 grep -v $$filecase "^$$fn\$$" | \
660 while read n; do \
661 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
662 done; \
663 done; \
664 done
665
e6e7b5f3
BM
666install_docs:
667 @$(PERL) $(TOP)/util/mkdir-p.pl \
e1c55191
UM
668 $(INSTALL_PREFIX)$(MANDIR)/man1 \
669 $(INSTALL_PREFIX)$(MANDIR)/man3 \
670 $(INSTALL_PREFIX)$(MANDIR)/man5 \
671 $(INSTALL_PREFIX)$(MANDIR)/man7
ec9f67f6
RL
672 here="`pwd`"; \
673 filecase=; \
457f7b14 674 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
ec9f67f6 675 filecase=-i; \
b3ef742c 676 esac; \
cfd06a62 677 set -e; for i in doc/apps/*.pod; do \
c6ce792f 678 fn=`basename $$i .pod`; \
401ee37a 679 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
1cc087fe 680 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 681 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 682 pod2man \
2962243d 683 --section=$$sec --center=OpenSSL \
a4a93411 684 --release=$(VERSION) `basename $$i`) \
1cc087fe 685 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 686 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
687 (grep -v $$filecase "^$$fn\$$"; true) | \
688 (grep -v "[ ]"; true) | \
ec9f67f6
RL
689 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
690 while read n; do \
220bd849 691 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 692 done); \
f6f99618 693 done; \
cfd06a62 694 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
c6ce792f 695 fn=`basename $$i .pod`; \
401ee37a 696 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
1cc087fe 697 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 698 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 699 pod2man \
2962243d 700 --section=$$sec --center=OpenSSL \
a4a93411 701 --release=$(VERSION) `basename $$i`) \
1cc087fe 702 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 703 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
704 (grep -v $$filecase "^$$fn\$$"; true) | \
705 (grep -v "[ ]"; true) | \
ec9f67f6
RL
706 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
707 while read n; do \
220bd849 708 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 709 done); \
c6ce792f 710 done
d02b48c6 711
9405a9a2
RS
712uninstall_docs:
713 @here="`pwd`"; \
714 filecase=; \
715 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
716 filecase=-i; \
717 esac; \
718 for i in doc/apps/*.pod; do \
719 fn=`basename $$i .pod`; \
720 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
721 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
722 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
723 $(PERL) util/extract-names.pl < $$i | \
724 (grep -v $$filecase "^$$fn\$$"; true) | \
725 (grep -v "[ ]"; true) | \
726 while read n; do \
727 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
728 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
729 done; \
730 done; \
731 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
732 fn=`basename $$i .pod`; \
733 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
734 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
735 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
736 $(PERL) util/extract-names.pl < $$i | \
737 (grep -v $$filecase "^$$fn\$$"; true) | \
738 (grep -v "[ ]"; true) | \
739 while read n; do \
740 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
741 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
742 done; \
743 done
744
d02b48c6 745# DO NOT DELETE THIS LINE -- make depend depends on it.