2 ## Makefile for OpenSSL
4 ## {- join("\n## ", @autowarntext) -}
6 VERSION
={- $config{version
} -}
7 MAJOR
={- $config{major
} -}
8 MINOR
={- $config{minor
} -}
9 SHLIB_VERSION_NUMBER
={- $config{shlib_version_number
} -}
10 SHLIB_VERSION_HISTORY
={- $config{shlib_version_history
} -}
11 SHLIB_MAJOR
={- $config{shlib_major
} -}
12 SHLIB_MINOR
={- $config{shlib_minor
} -}
13 SHLIB_EXT
={- $target{shared_extension
} ||
".so" -}
14 SHLIB_EXT_SIMPLE
={- $target{shared_extension_simple
} ||
".so" -}
15 SHLIB_EXT_IMPORT
={- $target{shared_import_extension
} ||
"" -}
16 DSO_EXT
={- $target{dso_extension
} ||
".so" -}
17 PLATFORM
={- $config{target
} -}
18 OPTIONS
={- $config{options
} -}
19 CONFIGURE_ARGS
=({- join(", ",quotify_l
(@
{$config{perlargv
}})) -})
20 SHLIB_TARGET
={- $target{shared_target
} -}
22 # HERE indicates where this Makefile lives. This can be used to indicate
23 # where sub-Makefiles are expected to be. Currently has very limited usage,
24 # and should probably not be bothered with at all.
27 # DESTDIR is for package builders so that they can configure
28 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
29 # Normally it is left empty.
32 # Do not edit these manually. Use Configure with --prefix or --openssldir
33 # to change this! Short explanation in the top comment in Configure
34 INSTALLTOP
={- # $prefix is used in the OPENSSLDIR perl snippet
36 our
$prefix = $config{prefix} ||
"/usr/local";
39 # The logic here is that if no --openssldir was given,
40 # OPENSSLDIR will get the value from $prefix plus "/ssl".
41 # If --openssldir was given and the value is an absolute
42 # path, OPENSSLDIR will get its value without change.
43 # If the value from --openssldir is a relative path,
44 # OPENSSLDIR will get $prefix with the --openssldir
45 # value appended as a subdirectory.
47 use File
::Spec
::Functions
;
50 (file_name_is_absolute
($config{openssldir
}) ?
52 : catdir
($prefix, $config{openssldir
}))
53 : catdir
($prefix, "ssl");
56 # if $prefix/lib$target{multilib} is not an existing
57 # directory, then assume that it's not searched by linker
58 # automatically, in which case adding $target{multilib} suffix
59 # causes more grief than we're ready to tolerate, so don't...
61 -d
"$prefix/lib$target{multilib}" ?
$target{multilib
} : "";
62 our
$libdir = $config{libdir} ||
"lib$multilib";
64 ENGINESDIR
={- use File
::Spec
::Functions
;
65 catdir
($prefix,$libdir,"engines") -}
67 # NO_IDEA - Define to build without the IDEA algorithm
68 # NO_RC4 - Define to build without the RC4 algorithm
69 # NO_RC2 - Define to build without the RC2 algorithm
70 # THREADS - Define when building with threads, you will probably also need any
71 # system defines as well, i.e. _REENTRANT for Solaris 2.[34]
72 # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
73 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
74 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
75 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
76 # one. 32 bytes will be read from this when the random
77 # number generator is initalised.
78 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
79 # NULL encryption ciphers.
81 # LOCK_DEBUG - turns on lots of lock debug output :-)
82 # REF_DEBUG - turn on some xyz_free() assertions.
83 # REF_PRINT - prints some stuff on structure free.
84 # MFUNC - Make all Malloc/Free/Realloc calls call
85 # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
86 # call application defined callbacks via CRYPTO_set_mem_functions()
87 # MD5_ASM needs to be defined to use the x86 assembler for MD5
88 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
89 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
90 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
92 # PKCS1_CHECK - pkcs1 tests.
94 CROSS_COMPILE
= {- $config{cross_compile_prefix
} -}
95 CC
= $(CROSS_COMPILE
){- $target{cc} -}
96 CFLAG
={- our
$cflags2 = join(" ",(map
{ "-D".
$_} @
{$config{defines
}},"OPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","ENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"")) -} {- $config{cflags} -}
97 CFLAG_Q
={- $cflags2 =~ s|
([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
98 LDFLAG= {- $config{lflags} -}
99 PLIB_LDFLAG= {- $config{plib_lflags} -}
100 EX_LIBS= {- $config{ex_libs} -}
101 EXE_EXT= {- $target{exe_extension} -}
102 ARFLAGS= {- $target{arflags} -}
103 AR=$(CROSS_COMPILE){- $target{ar} -} $(ARFLAGS) r
104 RANLIB= {- $target{ranlib} -}
105 NM= $(CROSS_COMPILE){- $target{nm} -}
106 PERL= {- $config{perl} -}
110 TARFLAGS= --no-recursion
111 MAKEDEPPROG=$(CROSS_COMPILE){- $config{makedepprog} -}
113 # We let the C compiler driver to take care of .s files. This is done in
114 # order to be excused from maintaining a separate set of architecture
115 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
116 # gcc, then the driver will automatically translate it to -xarch=v8plus
117 # and pass it down to assembler.
121 # For x86 assembler: Set PROCESSOR to 386 if you want to support
123 PROCESSOR= {- $config{processor} -}
125 # CPUID module collects small commonly used assembler snippets
126 APPS_OBJ={- $target{apps_obj} -}
127 CPUID_OBJ= {- $target{cpuid_obj} -}
128 BN_ASM= {- $target{bn_obj} -}
129 EC_ASM= {- $target{ec_obj} -}
130 DES_ENC= {- $target{des_obj} -}
131 AES_ENC= {- $target{aes_obj} -}
132 BF_ENC= {- $target{bf_obj} -}
133 CAST_ENC= {- $target{cast_obj} -}
134 RC4_ENC= {- $target{rc4_obj} -}
135 RC5_ENC= {- $target{rc5_obj} -}
136 MD5_ASM_OBJ= {- $target{md5_obj} -}
137 SHA1_ASM_OBJ= {- $target{sha1_obj} -}
138 RMD160_ASM_OBJ= {- $target{rmd160_obj} -}
139 WP_ASM_OBJ= {- $target{wp_obj} -}
140 CMLL_ENC= {- $target{cmll_obj} -}
141 MODES_ASM_OBJ= {- $target{modes_obj} -}
142 PADLOCK_ASM_OBJ= {- $target{padlock_obj} -}
143 CHACHA_ENC= {- $target{chacha_obj} -}
144 POLY1305_ASM_OBJ= {- $target{poly1305_obj} -}
145 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
148 ZLIB_INCLUDE={- $withargs{zlib_include} -}
149 LIBZLIB={- $withargs{zlib_lib} -}
151 # This is the location of fipscanister.o and friends.
152 # The FIPS module build will place it $(INSTALLTOP)/lib
153 # but since $(INSTALLTOP) can only take the default value
154 # when the module is built it will be in /usr/local/ssl/lib
155 # $(INSTALLTOP) for this build may be different so hard
158 FIPSLIBDIR={- $config{fipslibdir} -}
160 # The location of the library which contains fipscanister.o
161 # normally it will be libcrypto. If not compiling in FIPS mode
162 # at all this is empty making it a useful test for a FIPS compile.
164 FIPSCANLIB={- $config{fips} ? "libcrypto
" : "" -}
166 # Shared library base address. Currently only used on Windows.
169 BASEADDR={- $config{baseaddr} -}
171 DIRS= {- join(" ", @{$config{dirs}}) -}
172 SHLIBDIRS= crypto ssl
173 INSTALL_SUBS= engines apps tools
175 # dirs in crypto to build
176 SDIRS= {- join(" ", @{$config{sdirs}}) -}
178 # tests to perform. "alltests
" is a special word indicating that all tests
179 # should be performed.
184 MANDIR=$(INSTALLTOP)/share/man
189 HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
193 LIBS= libcrypto.a libssl.a
194 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
195 SHARED_SSL=libssl$(SHLIB_EXT)
196 SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
197 SHARED_LDFLAG={- $target{shared_ldflag}
198 # Unlike other OSes (like Solaris, Linux, Tru64,
199 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
200 # and FreeBSD) "demand
" RPATH set on .so objects.
201 # Apparently application RPATH is not global and
202 # does not apply to .so linked with other .so.
203 # Problem manifests itself when libssl.so fails to
204 # load libcrypto.so. One can argue that we should
205 # engrave this into Makefile.shared rules or into
206 # BSD-* config lines above. Meanwhile let's try to
207 # be cautious and pass -rpath to linker only when
208 # $prefix is not /usr.
209 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
210 ? " -Wl
,-rpath
,\
$\
$(LIBRPATH
)" : "") -}
211 SHARED_RCFLAG={- $target{shared_rcflag} -}
215 NAME= $(BASENAME)-$(VERSION)
216 TARFILE= ../$(NAME).tar
219 # Directories created on install if they don't exist.
221 $(DESTDIR)$(INSTALLTOP)/bin \
222 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR) \
223 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines \
224 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
225 $(DESTDIR)$(INSTALLTOP)/include/openssl \
226 $(DESTDIR)$(OPENSSLDIR)/misc \
227 $(DESTDIR)$(OPENSSLDIR)/certs \
228 $(DESTDIR)$(OPENSSLDIR)/private
230 all: Makefile build_all_but_tests
232 # as we stick to -e, CLEARENV ensures that local variables in lower
233 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
234 # shell, which [annoyingly enough] terminates unset with error if VAR
235 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
236 # which terminates unset with error if no variable was present:-(
237 CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
238 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
239 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
240 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
242 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
243 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
244 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
245 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
246 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
248 # LC_ALL=C ensures that error [and other] messages are delivered in
249 # same language for uniform treatment.
250 BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
251 CC='$(CC)' CFLAG='$(CFLAG)' CFLAG_Q='$(CFLAG_Q)' \
252 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
253 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
254 CROSS_COMPILE='$(CROSS_COMPILE)' \
256 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
257 DESTDIR='$(DESTDIR)' \
258 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
260 SHARED_LDFLAG='$(SHARED_LDFLAG)' \
261 SHARED_RCFLAG='$(SHARED_RCFLAG)' \
262 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
263 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
264 SHLIB_EXT='$(SHLIB_EXT)' DSO_EXT='$(DSO_EXT)' \
265 SHLIB_TARGET='$(SHLIB_TARGET)' \
267 PLIB_LDFLAG='$(PLIB_LDFLAG)' EX_LIBS='$(EX_LIBS)' \
268 APPS_OBJ='$(APPS_OBJ)' \
269 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
270 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
271 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
272 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
273 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
274 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
275 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
276 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
277 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
278 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
279 PADLOCK_ASM_OBJ='$(PADLOCK_ASM_OBJ)' \
280 CHACHA_ENC='$(CHACHA_ENC)' \
281 POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)' \
282 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
283 FIPSLIBDIR='${FIPSLIBDIR}' \
284 FIPSCANLIB="$${FIPSCANLIB
:-$(FIPSCANLIB
)}" \
285 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
286 # MAKEOVERRIDES= effectively "equalizes
" GNU-ish and SysV-ish make flavors,
287 # which in turn eliminates ambiguities in variable treatment with -e.
289 # BUILD_CMD is a generic macro to build a given target in a given
290 # subdirectory. The target must be given through the shell variable
291 # `target' and the subdirectory to build in must be given through `dir'.
292 # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
293 # BUILD_ONE_CMD instead.
295 # RECURSIVE_BUILD_CMD is a macro to build a given target in all
296 # subdirectories defined in $(DIRS). It requires that the target
297 # is given through the shell variable `target'.
299 # BUILD_ONE_CMD is a macro to build a given target in a given
300 # subdirectory if that subdirectory is part of $(DIRS). It requires
301 # exactly the same shell variables as BUILD_CMD.
302 BUILD_CMD= if [ -d "$$dir" ]; then \
303 ( cd $$dir && echo "making
$$target in
$$dir...
" && \
304 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
307 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
309 if expr " $(DIRS
) " : ".
* $$dir " >/dev/null 2>&1; then \
314 @[ -n "$(THIS
)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
318 build_all_but_tests: build_libs build_apps build_tools
319 build_all: build_all_but_tests build_tests
321 build_libs: build_libcrypto build_libssl openssl.pc
323 build_libcrypto: build_crypto build_engines libcrypto.pc
324 build_libssl: build_ssl libssl.pc
327 @dir=crypto; target=all; $(BUILD_ONE_CMD)
328 build_ssl: build_crypto
329 @dir=ssl; target=all; $(BUILD_ONE_CMD)
330 build_engines: build_crypto
331 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
333 build_apps: build_libs
334 @dir=apps; target=all; $(BUILD_ONE_CMD)
335 build_tests: build_libs
336 @dir=test; target=all; $(BUILD_ONE_CMD)
337 build_tools: build_libs
338 @dir=tools; target=all; $(BUILD_ONE_CMD)
340 all_testapps: build_libs build_testapps
342 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
344 libcrypto$(SHLIB_EXT): libcrypto.a
345 @if [ "$(SHLIB_TARGET
)" != "" ]; then \
346 if [ "$(FIPSCANLIB
)" = "libcrypto
" ]; then \
347 FIPSLD_CC="$(CC
)"; CC=fips/fipsld; \
348 export CC FIPSLD_CC; \
350 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC
:-$(CC
)}" build-shared; \
352 echo "There
's no support for shared libraries on this platform" >&2; \
356 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
357 @if [ "$(SHLIB_TARGET)" != "" ]; then \
358 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto
' build-shared; \
360 echo "There's no support for shared libraries on this platform
" >&2; \
365 @ set -e; for i in $(SHLIBDIRS); do \
366 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
367 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
368 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY
)" \
369 symlink.$(SHLIB_TARGET); \
370 libs="$$libs -l
$$i"; \
373 build-shared: do_$(SHLIB_TARGET) link-shared
376 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
377 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
378 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
379 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY
)" \
380 LIBDEPS="$$libs $(EX_LIBS
)" \
381 link_shlib.$(SHLIB_TARGET); \
382 libs="-l
$$i $$libs"; \
383 case "$(PLATFORM
)" in \
385 rm -f apps/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
386 rm -f test/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
387 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll apps/; \
388 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll test/; \
392 if expr $(PLATFORM) : mingw64 > /dev/null; then \
395 rm -f apps/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \
396 rm -f test/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \
397 cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll apps/; \
398 cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll test/; \
403 libcrypto.pc: Makefile
404 @ ( echo 'prefix=$(INSTALLTOP)'; \
405 echo 'exec_prefix=$${prefix}'; \
406 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
407 echo 'includedir=$${prefix}/include'; \
409 echo 'Name: OpenSSL-libcrypto'; \
410 echo 'Description: OpenSSL cryptography library'; \
411 echo 'Version: '$(VERSION); \
413 echo 'Libs: -L$${libdir} -lcrypto'; \
414 echo 'Libs.private: $(EX_LIBS)'; \
415 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
418 @ ( echo 'prefix=$(INSTALLTOP)'; \
419 echo 'exec_prefix=$${prefix}'; \
420 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
421 echo 'includedir=$${prefix}/include'; \
423 echo 'Name: OpenSSL-libssl'; \
424 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
425 echo 'Version: '$(VERSION); \
426 echo 'Requires.private: libcrypto'; \
427 echo 'Libs: -L$${libdir} -lssl'; \
428 echo 'Libs.private: $(EX_LIBS)'; \
429 echo 'Cflags: -I$${includedir}' ) > libssl.pc
432 @ ( echo 'prefix=$(INSTALLTOP)'; \
433 echo 'exec_prefix=$${prefix}'; \
434 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
435 echo 'includedir=$${prefix}/include'; \
437 echo 'Name: OpenSSL'; \
438 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
439 echo 'Version: '$(VERSION); \
440 echo 'Requires: libssl libcrypto' ) > openssl.pc
442 Makefile: Makefile.in Configure config
443 @echo "Makefile is older than Makefile.in
, Configure or config.
"
444 @echo "Reconfigure the source tree
(via
'./config' or
'perl Configure'), please.
"
448 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
451 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
452 rm -rf *.bak certs/.0
453 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
454 rm -f $(LIBS) tags TAGS
455 rm -f openssl.pc libssl.pc libcrypto.pc
460 $(PERL) util/mk1mf.pl >makefile.one; \
464 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
465 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
468 @(cd test && echo "generating dummy tests
(if needed
)...
" && \
469 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
472 rehash.time: certs build_apps build_tools
473 @if [ -z "$(CROSS_COMPILE
)" ]; then \
474 (OPENSSL="`pwd`/util
/opensslwrap.sh
"; \
475 [ -x "apps
/openssl.exe
" ] && OPENSSL="apps
/openssl.exe
" || :; \
476 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
477 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
478 $$OPENSSL rehash certs/demo \
479 || $(PERL) tools/c_rehash certs/demo) && \
486 tests: build_tests rehash
487 @(cd test && echo "testing...
" && \
488 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
489 @if [ -z "$(CROSS_COMPILE
)" ]; then \
490 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
495 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
498 @$(PERL) util/selftest.pl
503 -etags `find . -name '*.[ch]' -o -name '*.pm'`
508 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
510 update: generate errors ordinals depend
513 (cd apps && PERL='${PERL}' $(MAKE) generate)
514 (cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
515 (cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
518 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
519 $(PERL) util/mkerr.pl -recurse -write
520 (cd engines; $(MAKE) PERL=$(PERL) errors)
521 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
523 ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
525 $(PERL) util/mkdef.pl crypto update
527 $(PERL) util/mkdef.pl ssl update
529 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
531 TABLE: Configure Configurations/*.conf
532 (echo 'Output of `Configure TABLE'"':"; \
533 $(PERL) Configure TABLE) > TABLE
535 # Build distribution tar-file. As the list of files returned by "find" is
536 # pretty long, on several platforms a "too many arguments" error or similar
537 # would occur. Therefore the list of files is temporarily stored into a file
538 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
539 # tar does not support the --files-from option.
540 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
541 --owner 0 --group 0 \
542 --transform 's|^|
$(NAME
)/|
' \
546 git diff --quiet HEAD
547 git ls-files | sort > $(TARFILE).list
550 find . -type d -print | xargs chmod 755
551 find . -type f -print | xargs chmod a+r
552 find . -type f -perm -0100 -print | xargs chmod a+x
553 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
554 rm -f $(TARFILE).list
557 tar-snap: $(TARFILE).list
558 $(TAR_COMMAND) > $(TARFILE)
559 rm -f $(TARFILE).list
563 $(PERL) Configure dist
564 @$(MAKE) SDIRS='$(SDIRS
)' clean
565 @$(MAKE) TAR='$(TAR
)' TARFLAGS='$(TARFLAGS
)' $(DISTTARVARS) tar
567 install: all install_docs install_sw
569 uninstall: uninstall_sw uninstall_docs
572 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
573 @set -e; for i in include/openssl/*.h; do \
574 (cp $$i $(DESTDIR)$(INSTALLTOP)/$$i; \
575 chmod 644 $(DESTDIR)$(INSTALLTOP)/$$i ); \
577 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
578 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
580 if [ -f "$$i" ]; then \
581 ( echo installing $$i; \
582 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
583 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
584 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
585 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
588 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
589 tmp="$(SHARED_LIBS)"; \
590 for i in $${tmp:-x}; \
592 if [ -f "$$i" -o -f "$$i.a" ]; then \
593 case "$(PLATFORM)" in \
595 c=`echo $$i | sed 's
/^lib\
(.
*\
)\.dll
/cyg\
1-$(SHLIB_VERSION_NUMBER
).dll
/'`; \
596 echo installing $$c; \
597 cp $$c $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
598 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
599 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$c.new $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
600 echo installing $$i.a; \
601 cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
602 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
603 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
607 if expr $(PLATFORM) : mingw64 > /dev/null; then \
610 m=`echo $$i | sed -e 's
/\.dll
$$/-$(SHLIB_MAJOR
)_
$(SHLIB_MINOR
)'"$$arch"'.dll
/'`; \
611 echo installing $$m; \
612 cp $$m $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \
613 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \
614 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$m.new $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
615 echo installing $$i.a; \
616 cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
617 chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \
618 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
621 echo installing $$i; \
622 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
623 chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
624 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
630 cd $(DESTDIR)$(INSTALLTOP)/$(LIBDIR); \
631 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
632 if [ "$(INSTALLTOP)" != "/usr" ]; then \
633 echo 'OpenSSL shared libraries have been installed in
:'; \
634 echo ' $(INSTALLTOP
)'; \
637 cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
638 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
639 cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
640 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
641 cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
642 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
645 cd include/openssl && files=* && cd $(DESTDIR)$(INSTALLTOP)/include/openssl && $(RM) $$files
649 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i && \
650 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
652 @if [ -n "$(SHARED_LIBS)" ]; then \
653 tmp="$(SHARED_LIBS)"; \
654 for i in $${tmp:-x}; \
656 if [ -f "$$i" -o -f "$$i.a" ]; then \
657 case "$(PLATFORM)" in \
659 c=`echo $$i | sed 's
/^lib\
(.
*\
)\.dll
/cyg\
1-$(SHLIB_VERSION_NUMBER
).dll
/'`; \
660 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
661 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
662 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
663 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
667 if expr $(PLATFORM) : mingw64 > /dev/null; then \
670 m=`echo $$i | sed -e 's
/\.dll
$$/-$(SHLIB_MAJOR
)_
$(SHLIB_MINOR
)'"$$arch"'.dll
/'`; \
671 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
672 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \
673 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
674 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \
677 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
678 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
684 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
685 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
686 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
687 @target=uninstall; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
692 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
695 for subdir in apps crypto ssl; do \
696 $(PERL) $(TOP)/util/mkdir-p $(DESTDIR)$(HTMLDIR)/$$subdir; \
697 for i in doc/$$subdir/*.pod; do \
698 fn=`basename $$i .pod`; \
699 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
701 | sed -r 's
/L
<([^
)]*)(\
([0-9]\
))?\|
([^
)]*)(\
([0-9]\
))?
>/L
<\
1|\
3>/g
' \
702 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
703 | sed -r 's
/<!DOCTYPE.
*//g
' \
704 > $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
705 $(PERL) util/extract-names.pl < $$i | \
706 grep -v $$filecase "^$$fn\$$" | \
707 (cd $(DESTDIR)$(HTMLDIR)/$$subdir; \
709 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
717 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
720 for subdir in apps crypto ssl; do \
721 for i in doc/$$subdir/*.pod; do \
722 fn=`basename $$i .pod`; \
723 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
724 $(PERL) util/extract-names.pl < $$i | \
725 grep -v $$filecase "^$$fn\$$" | \
727 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
733 @$(PERL) $(TOP)/util/mkdir-p.pl \
734 $(DESTDIR)$(MANDIR)/man1 \
735 $(DESTDIR)$(MANDIR)/man3 \
736 $(DESTDIR)$(MANDIR)/man5 \
737 $(DESTDIR)$(MANDIR)/man7
740 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
743 set -e; for i in doc/apps/*.pod; do \
744 fn=`basename $$i .pod`; \
745 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
746 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
747 (cd `$(PERL) util/dirname.pl $$i`; \
749 --section=$$sec --center=OpenSSL \
750 --release=$(VERSION) `basename $$i`) \
751 > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
752 $(PERL) util/extract-names.pl < $$i | \
753 (grep -v $$filecase "^$$fn\$$"; true) | \
754 (grep -v "[ ]"; true) | \
755 (cd $(DESTDIR)$(MANDIR)/man$$sec/; \
757 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
760 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
761 fn=`basename $$i .pod`; \
762 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
763 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
764 (cd `$(PERL) util/dirname.pl $$i`; \
766 --section=$$sec --center=OpenSSL \
767 --release=$(VERSION) `basename $$i`) \
768 > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
769 $(PERL) util/extract-names.pl < $$i | \
770 (grep -v $$filecase "^$$fn\$$"; true) | \
771 (grep -v "[ ]"; true) | \
772 (cd $(DESTDIR)$(MANDIR)/man$$sec/; \
774 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
781 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
784 for i in doc/apps/*.pod; do \
785 fn=`basename $$i .pod`; \
786 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
787 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
788 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
789 $(PERL) util/extract-names.pl < $$i | \
790 (grep -v $$filecase "^$$fn\$$"; true) | \
791 (grep -v "[ ]"; true) | \
793 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
794 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
797 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
798 fn=`basename $$i .pod`; \
799 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
800 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
801 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
802 $(PERL) util/extract-names.pl < $$i | \
803 (grep -v $$filecase "^$$fn\$$"; true) | \
804 (grep -v "[ ]"; true) | \
806 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
807 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
811 # DO NOT DELETE THIS LINE -- make depend depends on it.