]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.org
Remove remaining Kerberos references
[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
0962fbbf 190all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
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
f072785e 275build_libs: build_crypto build_ssl build_engines
88c80b3e
RL
276
277build_crypto:
f072785e 278 @dir=crypto; target=all; $(BUILD_ONE_CMD)
c3f22253 279build_ssl: build_crypto
f5ce5e14 280 @dir=ssl; target=all; $(BUILD_ONE_CMD)
c3f22253 281build_engines: build_crypto
ed28aef8 282 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
c3f22253
RS
283
284build_apps: build_libs
f5ce5e14 285 @dir=apps; target=all; $(BUILD_ONE_CMD)
c3f22253 286build_tests: build_libs
f5ce5e14 287 @dir=test; target=all; $(BUILD_ONE_CMD)
c3f22253 288build_tools: build_libs
f5ce5e14 289 @dir=tools; target=all; $(BUILD_ONE_CMD)
ba5477eb
RL
290
291all_testapps: build_libs build_testapps
292build_testapps:
f5ce5e14 293 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
b436a982 294
f072785e 295libcrypto$(SHLIB_EXT): libcrypto.a
f4316c36 296 @if [ "$(SHLIB_TARGET)" != "" ]; then \
225c2721
DSH
297 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
298 FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
299 export CC FIPSLD_CC; \
300 fi; \
24e20db4 301 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \
f4316c36
RL
302 else \
303 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 304 exit 1; \
f4316c36 305 fi
0f180d1d 306
a22fb399 307libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
f4316c36 308 @if [ "$(SHLIB_TARGET)" != "" ]; then \
5ddcb866 309 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
f4316c36
RL
310 else \
311 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 312 exit 1; \
f4316c36 313 fi
b436a982
RL
314
315clean-shared:
cfd06a62 316 @set -e; for i in $(SHLIBDIRS); do \
a22fb399
RL
317 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
318 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
319 for j in $${tmp:-x}; do \
320 ( set -x; rm -f lib$$i$$j ); \
321 done; \
322 fi; \
323 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
b3ef742c 324 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
1fe198b6
RL
325 ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
326 fi; \
b436a982 327 done
d02b48c6 328
a22fb399 329link-shared:
a370537b 330 @ set -e; for i in $(SHLIBDIRS); do \
755c5b33 331 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
a370537b
AP
332 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
333 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07 334 symlink.$(SHLIB_TARGET); \
6b86bad5 335 libs="$$libs -l$$i"; \
0fd44e2d
RL
336 done
337
30afcc07
RL
338build-shared: do_$(SHLIB_TARGET) link-shared
339
340do_$(SHLIB_TARGET):
a370537b 341 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
02c31fa4 342 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
a370537b
AP
343 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
344 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07
RL
345 LIBDEPS="$$libs $(EX_LIBS)" \
346 link_a.$(SHLIB_TARGET); \
c1269c81 347 libs="-l$$i $$libs"; \
a3fffd64
RL
348 done
349
0962fbbf
RL
350libcrypto.pc: Makefile
351 @ ( echo 'prefix=$(INSTALLTOP)'; \
352 echo 'exec_prefix=$${prefix}'; \
6727565a 353 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
354 echo 'includedir=$${prefix}/include'; \
355 echo ''; \
356 echo 'Name: OpenSSL-libcrypto'; \
357 echo 'Description: OpenSSL cryptography library'; \
358 echo 'Version: '$(VERSION); \
359 echo 'Requires: '; \
04296664
DSH
360 echo 'Libs: -L$${libdir} -lcrypto'; \
361 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 362 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
0962fbbf
RL
363
364libssl.pc: Makefile
365 @ ( echo 'prefix=$(INSTALLTOP)'; \
366 echo 'exec_prefix=$${prefix}'; \
6727565a 367 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
368 echo 'includedir=$${prefix}/include'; \
369 echo ''; \
e6479c76 370 echo 'Name: OpenSSL-libssl'; \
0962fbbf
RL
371 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
372 echo 'Version: '$(VERSION); \
e6479c76
MF
373 echo 'Requires.private: libcrypto'; \
374 echo 'Libs: -L$${libdir} -lssl'; \
04296664 375 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 376 echo 'Cflags: -I$${includedir}' ) > libssl.pc
0962fbbf 377
42ba5d23 378openssl.pc: Makefile
56824b96
RL
379 @ ( echo 'prefix=$(INSTALLTOP)'; \
380 echo 'exec_prefix=$${prefix}'; \
6727565a 381 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
56824b96
RL
382 echo 'includedir=$${prefix}/include'; \
383 echo ''; \
384 echo 'Name: OpenSSL'; \
385 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
386 echo 'Version: '$(VERSION); \
e6479c76 387 echo 'Requires: libssl libcrypto' ) > openssl.pc
56824b96 388
c7199e62
BL
389Makefile: Makefile.org Configure config
390 @echo "Makefile is older than Makefile.org, Configure or config."
49b81422 391 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
9535d202
BL
392 @false
393
dfeab068 394libclean:
acb2f06a 395 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
dfeab068 396
7841edc9 397clean: libclean
9598996c 398 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
56999ba5 399 rm -rf *.bak certs/.0
02c31fa4 400 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
34ccd24d 401 rm -f $(LIBS) tags TAGS
0962fbbf 402 rm -f openssl.pc libssl.pc libcrypto.pc
7841edc9 403 rm -f speed.* .pure
bb8f3c58 404 rm -f $(TARFILE)
d02b48c6
RE
405
406makefile.one: files
99aab161 407 $(PERL) util/mk1mf.pl >makefile.one; \
d02b48c6
RE
408 sh util/do_ms.sh
409
bacad008 410files:
42ba5d23 411 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
02c31fa4 412 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
d02b48c6 413
1cc67fa8
RL
414gentests:
415 @(cd test && echo "generating dummy tests (if needed)..." && \
a370537b 416 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
1cc67fa8 417
d02b48c6 418dclean:
02c31fa4 419 @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
d02b48c6 420
0431941e
DSH
421rehash: rehash.time
422rehash.time: certs apps
34775923 423 @if [ -z "$(CROSS_COMPILE)" ]; then \
0431941e
DSH
424 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
425 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
bea6cd3e
RS
426 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
427 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
fefc111a 428 $(PERL) tools/c_rehash certs/demo) && \
0431941e
DSH
429 touch rehash.time; \
430 else :; fi
431
58964a49 432test: tests
d02b48c6 433
0431941e 434tests: rehash
bb8f3c58 435 @(cd test && echo "testing..." && \
220bd849
DSH
436 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
437 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
d02b48c6 438
d7f0ab5f
UM
439report:
440 @$(PERL) util/selftest.pl
441
d02b48c6 442depend:
02c31fa4 443 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
d02b48c6
RE
444
445lint:
02c31fa4 446 @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
d02b48c6 447
34ccd24d
RS
448tags TAGS: FORCE
449 rm -f TAGS tags
450 -ctags -R .
451 -etags -R .
452
453FORCE:
d02b48c6
RE
454
455errors:
797c61aa 456 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
f6485909 457 $(PERL) util/mkerr.pl -recurse -write
506fec1a 458 (cd engines; $(MAKE) PERL=$(PERL) errors)
d02b48c6 459
a6fbcb42
DSH
460stacks:
461 $(PERL) util/mkstack.pl -write
462
7740a1c6 463util/libeay.num::
f6485909 464 $(PERL) util/mkdef.pl crypto update
7740a1c6
BM
465
466util/ssleay.num::
f6485909 467 $(PERL) util/mkdef.pl ssl update
7740a1c6 468
dee502be
RL
469crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl include/openssl/obj_mac.h
470 $(PERL) crypto/objects/obj_dat.pl include/openssl/obj_mac.h crypto/objects/obj_dat.h
471include/openssl/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
472 $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num include/openssl/obj_mac.h
a19c9f17 473crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
aaa29f9e 474 $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
49e747e6 475
2faa930b
RL
476apps/openssl-vms.cnf: apps/openssl.cnf
477 $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
478
11cd2397
RL
479crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
480 $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
481
482
97a0cc52 483TABLE: Configure Configurations/*.conf
2330e18b 484 (echo 'Output of `Configure TABLE'"':"; \
f6485909 485 $(PERL) Configure TABLE) > TABLE
7740a1c6 486
a6fbcb42 487update: 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 488
f9de8446
LJ
489# Build distribution tar-file. As the list of files returned by "find" is
490# pretty long, on several platforms a "too many arguments" error or similar
491# would occur. Therefore the list of files is temporarily stored into a file
492# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
493# tar does not support the --files-from option.
d02b48c6 494tar:
756b9a00
LJ
495 find . -type d -print | xargs chmod 755
496 find . -type f -print | xargs chmod a+r
497 find . -type f -perm -0100 -print | xargs chmod a+x
5b8aa1a2 498 find * \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
f9de8446 499 $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
5a061129 500 tardy --user_number=0 --user_name=openssl \
9ce5db45
RE
501 --group_number=0 --group_name=openssl \
502 --prefix=openssl-$(VERSION) - |\
651d0aff 503 gzip --best >../$(TARFILE).gz; \
f9de8446 504 rm -f ../$(TARFILE).list; \
651d0aff 505 ls -l ../$(TARFILE).gz
d02b48c6 506
41d2a336
RL
507tar-snap:
508 @$(TAR) $(TARFLAGS) -cvf - \
5b8aa1a2 509 `find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
41d2a336
RL
510 tardy --user_number=0 --user_name=openssl \
511 --group_number=0 --group_name=openssl \
512 --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
513 ls -l ../$(TARFILE)
514
58964a49 515dist:
99aab161 516 $(PERL) Configure dist
d02b48c6 517 @$(MAKE) dist_pem_h
a370537b
AP
518 @$(MAKE) SDIRS='$(SDIRS)' clean
519 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
d02b48c6
RE
520
521dist_pem_h:
02c31fa4 522 (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
d02b48c6 523
28a80034
RL
524install: all install_docs install_sw
525
9405a9a2
RS
526uninstall: uninstall_sw uninstall_docs
527
28a80034 528install_sw:
9405a9a2 529 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
dee502be
RL
530 @set -e; for i in include/openssl/*.h; do \
531 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
532 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
2a4a0a34 533 done;
dee502be 534 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
d341e402 535 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
d02b48c6 536 do \
b436a982
RL
537 if [ -f "$$i" ]; then \
538 ( echo installing $$i; \
6727565a
DSH
539 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
540 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
541 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
542 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
2c975b50
LJ
543 fi; \
544 done;
cfd06a62 545 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
a22fb399
RL
546 tmp="$(SHARED_LIBS)"; \
547 for i in $${tmp:-x}; \
548 do \
1fe198b6 549 if [ -f "$$i" -o -f "$$i.a" ]; then \
a22fb399 550 ( echo installing $$i; \
65370f9b 551 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
447aa490 552 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
7104c376
RL
553 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
554 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
30c08f2e 555 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
6727565a
DSH
556 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
557 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
558 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
65370f9b
AP
559 else \
560 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
561 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
562 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
1fe198b6 563 fi ); \
4c1a6e00
LJ
564 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
565 ( case $$i in \
566 *crypto*) i=libeay32.dll;; \
567 *ssl*) i=ssleay32.dll;; \
568 esac; \
569 echo installing $$i; \
9405a9a2
RS
570 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
571 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
572 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
4c1a6e00 573 fi; \
2c975b50 574 fi; \
a22fb399
RL
575 done; \
576 ( here="`pwd`"; \
72a9776a 577 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
4c3a2d64 578 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
e68cb95d
RL
579 if [ "$(INSTALLTOP)" != "/usr" ]; then \
580 echo 'OpenSSL shared libraries have been installed in:'; \
581 echo ' $(INSTALLTOP)'; \
e68cb95d 582 fi; \
a22fb399 583 fi
6727565a
DSH
584 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
585 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
586 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
587 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
588 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
589 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
e6e7b5f3 590
9405a9a2
RS
591uninstall_sw:
592 cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
593 @for i in $(LIBS) ;\
594 do \
595 test -f "$$i" && \
596 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
597 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
598 done;
599 @if [ -n "$(SHARED_LIBS)" ]; then \
600 tmp="$(SHARED_LIBS)"; \
601 for i in $${tmp:-x}; \
602 do \
603 if [ -f "$$i" -o -f "$$i.a" ]; then \
604 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
605 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
606 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
607 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
608 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
609 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
610 else \
611 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
612 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
613 fi; \
614 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
615 case $$i in \
616 *crypto*) i=libeay32.dll;; \
617 *ssl*) i=ssleay32.dll;; \
618 esac; \
619 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
620 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
621 fi; \
622 fi; \
623 done; \
624 fi
625 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
626 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
627 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
628 @target=uninstall; $(RECURSIVE_BUILD_CMD)
629
60cdb821
UM
630install_html_docs:
631 here="`pwd`"; \
82d9185a 632 filecase=; \
457f7b14 633 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
82d9185a
JR
634 filecase=-i; \
635 esac; \
60cdb821 636 for subdir in apps crypto ssl; do \
9405a9a2 637 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
60cdb821
UM
638 for i in doc/$$subdir/*.pod; do \
639 fn=`basename $$i .pod`; \
640 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
641 cat $$i \
642 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
690a2b1f 643 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
60cdb821
UM
644 | sed -r 's/<!DOCTYPE.*//g' \
645 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
646 $(PERL) util/extract-names.pl < $$i | \
647 grep -v $$filecase "^$$fn\$$" | \
648 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
649 while read n; do \
220bd849 650 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
60cdb821
UM
651 done); \
652 done; \
653 done
654
9405a9a2
RS
655uninstall_html_docs:
656 here="`pwd`"; \
657 filecase=; \
658 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
659 filecase=-i; \
660 esac; \
661 for subdir in apps crypto ssl; do \
662 for i in doc/$$subdir/*.pod; do \
663 fn=`basename $$i .pod`; \
664 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
665 $(PERL) util/extract-names.pl < $$i | \
666 grep -v $$filecase "^$$fn\$$" | \
667 while read n; do \
668 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
669 done; \
670 done; \
671 done
672
e6e7b5f3
BM
673install_docs:
674 @$(PERL) $(TOP)/util/mkdir-p.pl \
e1c55191
UM
675 $(INSTALL_PREFIX)$(MANDIR)/man1 \
676 $(INSTALL_PREFIX)$(MANDIR)/man3 \
677 $(INSTALL_PREFIX)$(MANDIR)/man5 \
678 $(INSTALL_PREFIX)$(MANDIR)/man7
ec9f67f6
RL
679 here="`pwd`"; \
680 filecase=; \
457f7b14 681 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
ec9f67f6 682 filecase=-i; \
b3ef742c 683 esac; \
cfd06a62 684 set -e; for i in doc/apps/*.pod; do \
c6ce792f 685 fn=`basename $$i .pod`; \
401ee37a 686 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
1cc087fe 687 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 688 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 689 pod2man \
2962243d 690 --section=$$sec --center=OpenSSL \
a4a93411 691 --release=$(VERSION) `basename $$i`) \
1cc087fe 692 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 693 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
694 (grep -v $$filecase "^$$fn\$$"; true) | \
695 (grep -v "[ ]"; true) | \
ec9f67f6
RL
696 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
697 while read n; do \
220bd849 698 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 699 done); \
f6f99618 700 done; \
cfd06a62 701 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
c6ce792f 702 fn=`basename $$i .pod`; \
401ee37a 703 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
1cc087fe 704 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 705 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 706 pod2man \
2962243d 707 --section=$$sec --center=OpenSSL \
a4a93411 708 --release=$(VERSION) `basename $$i`) \
1cc087fe 709 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 710 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
711 (grep -v $$filecase "^$$fn\$$"; true) | \
712 (grep -v "[ ]"; true) | \
ec9f67f6
RL
713 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
714 while read n; do \
220bd849 715 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 716 done); \
c6ce792f 717 done
d02b48c6 718
9405a9a2
RS
719uninstall_docs:
720 @here="`pwd`"; \
721 filecase=; \
722 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
723 filecase=-i; \
724 esac; \
725 for i in doc/apps/*.pod; do \
726 fn=`basename $$i .pod`; \
727 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
728 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
729 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
730 $(PERL) util/extract-names.pl < $$i | \
731 (grep -v $$filecase "^$$fn\$$"; true) | \
732 (grep -v "[ ]"; true) | \
733 while read n; do \
734 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
735 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
736 done; \
737 done; \
738 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
739 fn=`basename $$i .pod`; \
740 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
741 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
742 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
743 $(PERL) util/extract-names.pl < $$i | \
744 (grep -v $$filecase "^$$fn\$$"; true) | \
745 (grep -v "[ ]"; true) | \
746 while read n; do \
747 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
748 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
749 done; \
750 done
751
d02b48c6 752# DO NOT DELETE THIS LINE -- make depend depends on it.