]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.in
Comment side-effect only calls of X509_check_purpose
[thirdparty/openssl.git] / Makefile.in
CommitLineData
d56128f0
RE
1##
2## Makefile for OpenSSL
3##
9ab6fc59 4## {- join("\n## ", @autowarntext) -}
d56128f0 5
107b5792
RL
6VERSION={- $config{version} -}
7MAJOR={- $config{major} -}
8MINOR={- $config{minor} -}
9SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
10SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
11SHLIB_MAJOR={- $config{shlib_major} -}
12SHLIB_MINOR={- $config{shlib_minor} -}
13SHLIB_EXT={- $target{shared_extension} -}
14PLATFORM={- $config{target} -}
15OPTIONS={- $config{options} -}
16CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
17SHLIB_TARGET={- $target{shared_target} -}
b436a982 18
30c08f2e
RL
19# HERE indicates where this Makefile lives. This can be used to indicate
20# where sub-Makefiles are expected to be. Currently has very limited usage,
21# and should probably not be bothered with at all.
22HERE=.
23
e5f3045f
BM
24# INSTALL_PREFIX is for package builders so that they can configure
25# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
26# Normally it is left empty.
107b5792 27INSTALL_PREFIX={- $config{install_prefix} -}
462ba4f6 28
d74dfafd
RL
29# Do not edit these manually. Use Configure with --prefix or --openssldir
30# to change this! Short explanation in the top comment in Configure
107b5792
RL
31INSTALLTOP={- $config{prefix} -}
32OPENSSLDIR={- $config{openssldir} -}
d56128f0 33
d02b48c6
RE
34# NO_IDEA - Define to build without the IDEA algorithm
35# NO_RC4 - Define to build without the RC4 algorithm
36# NO_RC2 - Define to build without the RC2 algorithm
37# THREADS - Define when building with threads, you will probably also need any
c98d63f2 38# system defines as well, i.e. _REENTRANT for Solaris 2.[34]
d02b48c6
RE
39# TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
40# TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
41# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
42# DEVRANDOM - Give this the value of the 'random device' if your OS supports
58964a49
RE
43# one. 32 bytes will be read from this when the random
44# number generator is initalised.
baf748ba 45# SSL_FORBID_ENULL - define if you want the server to be not able to use the
58964a49 46# NULL encryption ciphers.
d02b48c6
RE
47#
48# LOCK_DEBUG - turns on lots of lock debug output :-)
49# REF_CHECK - turn on some xyz_free() assertions.
58964a49 50# REF_PRINT - prints some stuff on structure free.
d02b48c6 51# MFUNC - Make all Malloc/Free/Realloc calls call
58964a49
RE
52# CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
53# call application defined callbacks via CRYPTO_set_mem_functions()
54# MD5_ASM needs to be defined to use the x86 assembler for MD5
55# SHA1_ASM needs to be defined to use the x86 assembler for SHA1
56# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
dfeab068
RE
57# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
58# equal 4.
59# PKCS1_CHECK - pkcs1 tests.
d02b48c6 60
107b5792
RL
61CROSS_COMPILE= {- $config{cross_compile_prefix} -}
62CC= $(CROSS_COMPILE){- $target{cc} -}
63CFLAG= {- $config{cflags} -}
64DEPFLAG= {- $config{depflags} -}
65PEX_LIBS= {- $config{prelflags} -}
66EX_LIBS= {- $config{lflags} -}
67EXE_EXT= {- $target{exe_extension} -}
68ARFLAGS= {- $target{arflags} -}
69AR=$(CROSS_COMPILE){- $target{ar} -} $(ARFLAGS) r
70RANLIB= {- $target{ranlib} -}
71NM= $(CROSS_COMPILE){- $target{nm} -}
72PERL= {- $config{perl} -}
9405a9a2
RS
73#RM= echo --
74RM= rm -f
2dbb3ccd 75TAR= tar
63977104 76TARFLAGS= --no-recursion
107b5792
RL
77MAKEDEPPROG=$(CROSS_COMPILE){- $config{makedepprog} -}
78LIBDIR={- $config{libdir} -}
d02b48c6 79
3cc9a89d
AP
80# We let the C compiler driver to take care of .s files. This is done in
81# order to be excused from maintaining a separate set of architecture
82# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
83# gcc, then the driver will automatically translate it to -xarch=v8plus
84# and pass it down to assembler.
f072785e 85AS=$(CC) -c
01fc834b 86ASFLAG=$(CFLAG)
3cc9a89d 87
14e21f86
AP
88# For x86 assembler: Set PROCESSOR to 386 if you want to support
89# the 80386.
107b5792 90PROCESSOR= {- $config{processor} -}
14e21f86
AP
91
92# CPUID module collects small commonly used assembler snippets
107b5792
RL
93CPUID_OBJ= {- $target{cpuid_obj} -}
94BN_ASM= {- $target{bn_obj} -}
95EC_ASM= {- $target{ec_obj} -}
96DES_ENC= {- $target{des_obj} -}
97AES_ENC= {- $target{aes_obj} -}
98BF_ENC= {- $target{bf_obj} -}
99CAST_ENC= {- $target{cast_obj} -}
100RC4_ENC= {- $target{rc4_obj} -}
101RC5_ENC= {- $target{rc5_obj} -}
102MD5_ASM_OBJ= {- $target{md5_obj} -}
103SHA1_ASM_OBJ= {- $target{sha1_obj} -}
104RMD160_ASM_OBJ= {- $target{rmd160_obj} -}
105WP_ASM_OBJ= {- $target{wp_obj} -}
106CMLL_ENC= {- $target{cmll_obj} -}
107MODES_ASM_OBJ= {- $target{modes_obj} -}
05e4e633 108PADLOCK_ASM_OBJ= {- $target{padlock_obj} -}
107b5792
RL
109CHACHA_ENC= {- $target{chacha_obj} -}
110POLY1305_ASM_OBJ= {- $target{poly1305_obj} -}
111PERLASM_SCHEME= {- $target{perlasm_scheme} -}
58964a49 112
ad2695b1 113# Zlib stuff
107b5792
RL
114ZLIB_INCLUDE={- $withargs{zlib-include} -}
115LIBZLIB={- $withargs{zlib-lib} -}
ad2695b1 116
1ab2f7f1
DSH
117# This is the location of fipscanister.o and friends.
118# The FIPS module build will place it $(INSTALLTOP)/lib
119# but since $(INSTALLTOP) can only take the default value
120# when the module is built it will be in /usr/local/ssl/lib
5084af28 121# $(INSTALLTOP) for this build may be different so hard
1ab2f7f1
DSH
122# code the path.
123
107b5792 124FIPSLIBDIR={- $config{fipslibdir} -}
1ab2f7f1 125
1ab2f7f1 126# The location of the library which contains fipscanister.o
f072785e
DSH
127# normally it will be libcrypto. If not compiling in FIPS mode
128# at all this is empty making it a useful test for a FIPS compile.
1ab2f7f1 129
107b5792 130FIPSCANLIB={- $config{fips} ? "libcrypto" : "" -}
1ab2f7f1
DSH
131
132# Shared library base address. Currently only used on Windows.
133#
134
107b5792 135BASEADDR={- $config{baseaddr} -}
1ab2f7f1 136
107b5792 137DIRS= {- join(" ", @{$config{dirs}}) -}
0973910f 138SHLIBDIRS= crypto ssl
dee502be 139INSTALL_SUBS= engines apps tools
0973910f 140
d02b48c6 141# dirs in crypto to build
107b5792 142SDIRS= {- join(" ", @{$config{sdirs}}) -}
d02b48c6 143
f777408f
RL
144# tests to perform. "alltests" is a special word indicating that all tests
145# should be performed.
146TESTS = alltests
147
42ba5d23 148MAKEFILE= Makefile
d02b48c6 149
d74dfafd 150MANDIR=$(INSTALLTOP)/share/man
d02b48c6
RE
151MAN1=1
152MAN3=3
1cc087fe 153MANSUFFIX=
60cdb821 154HTMLSUFFIX=html
d74dfafd 155HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
d02b48c6
RE
156SHELL=/bin/sh
157
58964a49 158TOP= .
b436a982 159LIBS= libcrypto.a libssl.a
a22fb399
RL
160SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
161SHARED_SSL=libssl$(SHLIB_EXT)
107b5792 162SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
107b5792 163SHARED_LDFLAGS={- $target{shared_ldflag} -}
58964a49
RE
164
165GENERAL= Makefile
9ce5db45 166BASENAME= openssl
58964a49 167NAME= $(BASENAME)-$(VERSION)
4a544810 168TARFILE= ../$(NAME).tar
58964a49 169HEADER= e_os.h
d02b48c6 170
9405a9a2
RS
171# Directories created on install if they don't exist.
172INSTALLDIRS= \
173 $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
174 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
175 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
176 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
177 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
178 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
179 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
180 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
181
177b5f9c 182all: Makefile build_all
d02b48c6 183
02c31fa4 184# as we stick to -e, CLEARENV ensures that local variables in lower
a41b0aad
AP
185# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
186# shell, which [annoyingly enough] terminates unset with error if VAR
187# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
188# which terminates unset with error if no variable was present:-(
189CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
02c31fa4
AP
190 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
191 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
192 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
a80e33b9 193 $${HEADER+HEADER} \
02c31fa4
AP
194 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
195 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
dce1cc2a 196 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
2f3c39bc 197 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
02c31fa4
AP
198 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
199
193ed2d7
AP
200# LC_ALL=C ensures that error [and other] messages are delivered in
201# same language for uniform treatment.
202BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
a370537b 203 CC='$(CC)' CFLAG='$(CFLAG)' \
f072785e 204 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
a370537b 205 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
34775923 206 CROSS_COMPILE='$(CROSS_COMPILE)' \
a8eda431 207 PERL='$(PERL)' \
6727565a 208 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
a370537b
AP
209 INSTALL_PREFIX='$(INSTALL_PREFIX)' \
210 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
19c5314f 211 LIBDIR='$(LIBDIR)' \
a370537b 212 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
721c2ac0 213 DEPFLAG='$(DEPFLAG)' \
a370537b
AP
214 MAKEDEPPROG='$(MAKEDEPPROG)' \
215 SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
cc7399e7 216 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
a370537b
AP
217 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
218 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
219 PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
6019cdd3 220 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
9405a9a2 221 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
a370537b
AP
222 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
223 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
224 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
225 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
226 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
227 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
228 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
8a1c92ce 229 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
05e4e633 230 PADLOCK_ASM_OBJ='$(PADLOCK_ASM_OBJ)' \
22c2e80f
AP
231 CHACHA_ENC='$(CHACHA_ENC)' \
232 POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)' \
a370537b 233 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
1ab2f7f1
DSH
234 FIPSLIBDIR='${FIPSLIBDIR}' \
235 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
02c31fa4
AP
236 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
237# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
238# which in turn eliminates ambiguities in variable treatment with -e.
d0590fe6 239
b480283c
RL
240# BUILD_CMD is a generic macro to build a given target in a given
241# subdirectory. The target must be given through the shell variable
242# `target' and the subdirectory to build in must be given through `dir'.
243# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
244# BUILD_ONE_CMD instead.
245#
b480283c
RL
246# RECURSIVE_BUILD_CMD is a macro to build a given target in all
247# subdirectories defined in $(DIRS). It requires that the target
248# is given through the shell variable `target'.
9405a9a2
RS
249#
250# BUILD_ONE_CMD is a macro to build a given target in a given
251# subdirectory if that subdirectory is part of $(DIRS). It requires
252# exactly the same shell variables as BUILD_CMD.
02c31fa4
AP
253BUILD_CMD= if [ -d "$$dir" ]; then \
254 ( cd $$dir && echo "making $$target in $$dir..." && \
255 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
256 ) || exit 1; \
257 fi
258RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
f5ce5e14 259BUILD_ONE_CMD=\
b3b201b6 260 if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
f5ce5e14
RL
261 $(BUILD_CMD); \
262 fi
88c80b3e 263
734540f8 264reflect:
02c31fa4 265 @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
734540f8 266
4c82171a 267sub_all: build_all
c3f22253 268
88c80b3e
RL
269build_all: build_libs build_apps build_tests build_tools
270
177b5f9c
RL
271build_libs: build_libcrypto build_libssl openssl.pc
272
273build_libcrypto: build_crypto build_engines libcrypto.pc
274build_libssl: build_ssl libssl.pc
88c80b3e
RL
275
276build_crypto:
f072785e 277 @dir=crypto; target=all; $(BUILD_ONE_CMD)
c3f22253 278build_ssl: build_crypto
f5ce5e14 279 @dir=ssl; target=all; $(BUILD_ONE_CMD)
c3f22253 280build_engines: build_crypto
ed28aef8 281 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
c3f22253
RS
282
283build_apps: build_libs
f5ce5e14 284 @dir=apps; target=all; $(BUILD_ONE_CMD)
c3f22253 285build_tests: build_libs
f5ce5e14 286 @dir=test; target=all; $(BUILD_ONE_CMD)
c3f22253 287build_tools: build_libs
f5ce5e14 288 @dir=tools; target=all; $(BUILD_ONE_CMD)
ba5477eb
RL
289
290all_testapps: build_libs build_testapps
291build_testapps:
f5ce5e14 292 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
b436a982 293
f072785e 294libcrypto$(SHLIB_EXT): libcrypto.a
f4316c36 295 @if [ "$(SHLIB_TARGET)" != "" ]; then \
225c2721
DSH
296 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
297 FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
298 export CC FIPSLD_CC; \
299 fi; \
24e20db4 300 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \
f4316c36
RL
301 else \
302 echo "There's no support for shared libraries on this platform" >&2; \
d0590fe6 303 exit 1; \
f4316c36 304 fi
0f180d1d 305
a22fb399 306libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
f4316c36 307 @if [ "$(SHLIB_TARGET)" != "" ]; then \
5ddcb866 308 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' 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
b436a982 313
a22fb399 314link-shared:
a370537b 315 @ set -e; for i in $(SHLIBDIRS); do \
755c5b33 316 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
a370537b
AP
317 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
318 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07 319 symlink.$(SHLIB_TARGET); \
6b86bad5 320 libs="$$libs -l$$i"; \
0fd44e2d
RL
321 done
322
30afcc07
RL
323build-shared: do_$(SHLIB_TARGET) link-shared
324
325do_$(SHLIB_TARGET):
a370537b 326 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
02c31fa4 327 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
a370537b
AP
328 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
329 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
30afcc07
RL
330 LIBDEPS="$$libs $(EX_LIBS)" \
331 link_a.$(SHLIB_TARGET); \
c1269c81 332 libs="-l$$i $$libs"; \
a3fffd64
RL
333 done
334
0962fbbf
RL
335libcrypto.pc: Makefile
336 @ ( echo 'prefix=$(INSTALLTOP)'; \
337 echo 'exec_prefix=$${prefix}'; \
6727565a 338 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
339 echo 'includedir=$${prefix}/include'; \
340 echo ''; \
341 echo 'Name: OpenSSL-libcrypto'; \
342 echo 'Description: OpenSSL cryptography library'; \
343 echo 'Version: '$(VERSION); \
344 echo 'Requires: '; \
04296664
DSH
345 echo 'Libs: -L$${libdir} -lcrypto'; \
346 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 347 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
0962fbbf
RL
348
349libssl.pc: Makefile
350 @ ( echo 'prefix=$(INSTALLTOP)'; \
351 echo 'exec_prefix=$${prefix}'; \
6727565a 352 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
0962fbbf
RL
353 echo 'includedir=$${prefix}/include'; \
354 echo ''; \
e6479c76 355 echo 'Name: OpenSSL-libssl'; \
0962fbbf
RL
356 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
357 echo 'Version: '$(VERSION); \
e6479c76
MF
358 echo 'Requires.private: libcrypto'; \
359 echo 'Libs: -L$${libdir} -lssl'; \
04296664 360 echo 'Libs.private: $(EX_LIBS)'; \
e36827f6 361 echo 'Cflags: -I$${includedir}' ) > libssl.pc
0962fbbf 362
42ba5d23 363openssl.pc: Makefile
56824b96
RL
364 @ ( echo 'prefix=$(INSTALLTOP)'; \
365 echo 'exec_prefix=$${prefix}'; \
6727565a 366 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
56824b96
RL
367 echo 'includedir=$${prefix}/include'; \
368 echo ''; \
369 echo 'Name: OpenSSL'; \
370 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
371 echo 'Version: '$(VERSION); \
e6479c76 372 echo 'Requires: libssl libcrypto' ) > openssl.pc
56824b96 373
d10dac11
RS
374Makefile: Makefile.in Configure config
375 @echo "Makefile is older than Makefile.in, Configure or config."
49b81422 376 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
9535d202
BL
377 @false
378
dfeab068 379libclean:
acb2f06a 380 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
dfeab068 381
7841edc9 382clean: libclean
9598996c 383 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
56999ba5 384 rm -rf *.bak certs/.0
02c31fa4 385 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
34ccd24d 386 rm -f $(LIBS) tags TAGS
0962fbbf 387 rm -f openssl.pc libssl.pc libcrypto.pc
7841edc9 388 rm -f speed.* .pure
bb8f3c58 389 rm -f $(TARFILE)
d02b48c6
RE
390
391makefile.one: files
99aab161 392 $(PERL) util/mk1mf.pl >makefile.one; \
d02b48c6
RE
393 sh util/do_ms.sh
394
bacad008 395files:
42ba5d23 396 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
02c31fa4 397 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
d02b48c6 398
1cc67fa8
RL
399gentests:
400 @(cd test && echo "generating dummy tests (if needed)..." && \
a370537b 401 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
1cc67fa8 402
0431941e 403rehash: rehash.time
ae41f971 404rehash.time: certs build_apps build_tools
34775923 405 @if [ -z "$(CROSS_COMPILE)" ]; then \
0431941e
DSH
406 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
407 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
bea6cd3e
RS
408 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
409 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
67949615
RL
410 $$OPENSSL rehash certs/demo \
411 || $(PERL) tools/c_rehash certs/demo) && \
0431941e
DSH
412 touch rehash.time; \
413 else :; fi
414
58964a49 415test: tests
d02b48c6 416
0aca86b3 417
0431941e 418tests: rehash
bb8f3c58 419 @(cd test && echo "testing..." && \
220bd849 420 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
1a3ae788
RS
421 @if [ -z "$(CROSS_COMPILE)" ]; then \
422 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
423 fi
d02b48c6 424
1780e6d9
RL
425list-tests:
426 @(cd test && \
427 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
428
d7f0ab5f
UM
429report:
430 @$(PERL) util/selftest.pl
431
34ccd24d
RS
432tags TAGS: FORCE
433 rm -f TAGS tags
434 -ctags -R .
7a64489f 435 -etags `find . -name '*.[ch]' -o -name '*.pm'`
34ccd24d
RS
436
437FORCE:
d02b48c6 438
8cef1212
RS
439depend:
440 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
441
442update: generate errors ordinals depend
443
444generate:
445 (cd apps && $(MAKE) generate)
446 (cd crypto/bn && $(MAKE) generate)
447 (cd crypto/objects && $(MAKE) generate)
448
d02b48c6 449errors:
797c61aa 450 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
f6485909 451 $(PERL) util/mkerr.pl -recurse -write
506fec1a 452 (cd engines; $(MAKE) PERL=$(PERL) errors)
cc79f06c 453 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
d02b48c6 454
8cef1212 455ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
7740a1c6 456util/libeay.num::
f6485909 457 $(PERL) util/mkdef.pl crypto update
7740a1c6 458util/ssleay.num::
f6485909 459 $(PERL) util/mkdef.pl ssl update
8cef1212
RS
460test_ordinals:
461 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
7740a1c6 462
97a0cc52 463TABLE: Configure Configurations/*.conf
2330e18b 464 (echo 'Output of `Configure TABLE'"':"; \
f6485909 465 $(PERL) Configure TABLE) > TABLE
7740a1c6 466
f9de8446
LJ
467# Build distribution tar-file. As the list of files returned by "find" is
468# pretty long, on several platforms a "too many arguments" error or similar
469# would occur. Therefore the list of files is temporarily stored into a file
470# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
471# tar does not support the --files-from option.
4a544810 472TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
2b0e65d0 473 --owner 0 --group 0 \
4a544810 474 --transform 's|^|$(NAME)/|' \
27f98436
RL
475 -cvf -
476
4a544810 477$(TARFILE).list:
2b0e65d0
RL
478 git diff --quiet HEAD
479 git ls-files | sort > $(TARFILE).list
27f98436 480
4a544810 481tar: $(TARFILE).list
756b9a00
LJ
482 find . -type d -print | xargs chmod 755
483 find . -type f -print | xargs chmod a+r
484 find . -type f -perm -0100 -print | xargs chmod a+x
4a544810
RL
485 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
486 rm -f $(TARFILE).list
487 ls -l $(TARFILE).gz
d02b48c6 488
4a544810
RL
489tar-snap: $(TARFILE).list
490 $(TAR_COMMAND) > $(TARFILE)
491 rm -f $(TARFILE).list
492 ls -l $(TARFILE)
41d2a336 493
58964a49 494dist:
99aab161 495 $(PERL) Configure dist
a370537b 496 @$(MAKE) SDIRS='$(SDIRS)' clean
4d3c30a1 497 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
d02b48c6 498
28a80034
RL
499install: all install_docs install_sw
500
9405a9a2
RS
501uninstall: uninstall_sw uninstall_docs
502
28a80034 503install_sw:
9405a9a2 504 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
dee502be
RL
505 @set -e; for i in include/openssl/*.h; do \
506 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
507 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
2a4a0a34 508 done;
dee502be 509 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
d341e402 510 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
d02b48c6 511 do \
b436a982
RL
512 if [ -f "$$i" ]; then \
513 ( echo installing $$i; \
6727565a
DSH
514 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
515 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
516 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
517 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
2c975b50
LJ
518 fi; \
519 done;
cfd06a62 520 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
a22fb399
RL
521 tmp="$(SHARED_LIBS)"; \
522 for i in $${tmp:-x}; \
523 do \
1fe198b6 524 if [ -f "$$i" -o -f "$$i.a" ]; then \
a22fb399 525 ( echo installing $$i; \
65370f9b 526 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
447aa490 527 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
7104c376
RL
528 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
529 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
30c08f2e 530 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
6727565a
DSH
531 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
532 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
533 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
65370f9b
AP
534 else \
535 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
536 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
537 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
1fe198b6 538 fi ); \
4c1a6e00
LJ
539 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
540 ( case $$i in \
541 *crypto*) i=libeay32.dll;; \
542 *ssl*) i=ssleay32.dll;; \
543 esac; \
544 echo installing $$i; \
9405a9a2
RS
545 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
546 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
547 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
4c1a6e00 548 fi; \
2c975b50 549 fi; \
a22fb399
RL
550 done; \
551 ( here="`pwd`"; \
72a9776a 552 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
4c3a2d64 553 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
e68cb95d
RL
554 if [ "$(INSTALLTOP)" != "/usr" ]; then \
555 echo 'OpenSSL shared libraries have been installed in:'; \
556 echo ' $(INSTALLTOP)'; \
e68cb95d 557 fi; \
a22fb399 558 fi
6727565a
DSH
559 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
560 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
561 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
562 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
563 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
564 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
e6e7b5f3 565
9405a9a2
RS
566uninstall_sw:
567 cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
568 @for i in $(LIBS) ;\
569 do \
570 test -f "$$i" && \
571 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
572 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
573 done;
574 @if [ -n "$(SHARED_LIBS)" ]; then \
575 tmp="$(SHARED_LIBS)"; \
576 for i in $${tmp:-x}; \
577 do \
578 if [ -f "$$i" -o -f "$$i.a" ]; then \
579 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
580 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
581 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
582 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
583 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
584 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
585 else \
586 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
587 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
588 fi; \
589 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
590 case $$i in \
591 *crypto*) i=libeay32.dll;; \
592 *ssl*) i=ssleay32.dll;; \
593 esac; \
594 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
595 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
596 fi; \
597 fi; \
598 done; \
599 fi
600 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
601 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
602 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
603 @target=uninstall; $(RECURSIVE_BUILD_CMD)
604
60cdb821
UM
605install_html_docs:
606 here="`pwd`"; \
82d9185a 607 filecase=; \
457f7b14 608 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
82d9185a
JR
609 filecase=-i; \
610 esac; \
60cdb821 611 for subdir in apps crypto ssl; do \
9405a9a2 612 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
60cdb821
UM
613 for i in doc/$$subdir/*.pod; do \
614 fn=`basename $$i .pod`; \
615 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
616 cat $$i \
617 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
690a2b1f 618 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
60cdb821
UM
619 | sed -r 's/<!DOCTYPE.*//g' \
620 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
621 $(PERL) util/extract-names.pl < $$i | \
622 grep -v $$filecase "^$$fn\$$" | \
623 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
624 while read n; do \
220bd849 625 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
60cdb821
UM
626 done); \
627 done; \
628 done
629
9405a9a2
RS
630uninstall_html_docs:
631 here="`pwd`"; \
632 filecase=; \
633 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
634 filecase=-i; \
635 esac; \
636 for subdir in apps crypto ssl; do \
637 for i in doc/$$subdir/*.pod; do \
638 fn=`basename $$i .pod`; \
639 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
640 $(PERL) util/extract-names.pl < $$i | \
641 grep -v $$filecase "^$$fn\$$" | \
642 while read n; do \
643 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
644 done; \
645 done; \
646 done
647
e6e7b5f3
BM
648install_docs:
649 @$(PERL) $(TOP)/util/mkdir-p.pl \
e1c55191
UM
650 $(INSTALL_PREFIX)$(MANDIR)/man1 \
651 $(INSTALL_PREFIX)$(MANDIR)/man3 \
652 $(INSTALL_PREFIX)$(MANDIR)/man5 \
653 $(INSTALL_PREFIX)$(MANDIR)/man7
ec9f67f6
RL
654 here="`pwd`"; \
655 filecase=; \
457f7b14 656 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
ec9f67f6 657 filecase=-i; \
b3ef742c 658 esac; \
cfd06a62 659 set -e; for i in doc/apps/*.pod; do \
c6ce792f 660 fn=`basename $$i .pod`; \
401ee37a 661 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
1cc087fe 662 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 663 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 664 pod2man \
2962243d 665 --section=$$sec --center=OpenSSL \
a4a93411 666 --release=$(VERSION) `basename $$i`) \
1cc087fe 667 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 668 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
669 (grep -v $$filecase "^$$fn\$$"; true) | \
670 (grep -v "[ ]"; true) | \
ec9f67f6
RL
671 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
672 while read n; do \
220bd849 673 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 674 done); \
f6f99618 675 done; \
cfd06a62 676 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
c6ce792f 677 fn=`basename $$i .pod`; \
401ee37a 678 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
1cc087fe 679 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
d13363af 680 (cd `$(PERL) util/dirname.pl $$i`; \
a4a93411 681 pod2man \
2962243d 682 --section=$$sec --center=OpenSSL \
a4a93411 683 --release=$(VERSION) `basename $$i`) \
1cc087fe 684 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
ec9f67f6 685 $(PERL) util/extract-names.pl < $$i | \
f6098f2d
RL
686 (grep -v $$filecase "^$$fn\$$"; true) | \
687 (grep -v "[ ]"; true) | \
ec9f67f6
RL
688 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
689 while read n; do \
220bd849 690 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
ec9f67f6 691 done); \
c6ce792f 692 done
d02b48c6 693
9405a9a2
RS
694uninstall_docs:
695 @here="`pwd`"; \
696 filecase=; \
697 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
698 filecase=-i; \
699 esac; \
700 for i in doc/apps/*.pod; do \
701 fn=`basename $$i .pod`; \
702 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
703 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
704 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
705 $(PERL) util/extract-names.pl < $$i | \
706 (grep -v $$filecase "^$$fn\$$"; true) | \
707 (grep -v "[ ]"; true) | \
708 while read n; do \
709 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
710 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
711 done; \
712 done; \
713 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
714 fn=`basename $$i .pod`; \
715 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
716 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
717 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
718 $(PERL) util/extract-names.pl < $$i | \
719 (grep -v $$filecase "^$$fn\$$"; true) | \
720 (grep -v "[ ]"; true) | \
721 while read n; do \
722 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
723 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
724 done; \
725 done
726
d02b48c6 727# DO NOT DELETE THIS LINE -- make depend depends on it.