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