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
} -}
14 PLATFORM
={- $config{target
} -}
15 OPTIONS
={- $config{options
} -}
16 CONFIGURE_ARGS
=({- join(", ",quotify_l
(@
{$config{perlargv
}})) -})
17 SHLIB_TARGET
={- $target{shared_target
} -}
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.
24 # DESTDIR 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.
29 # Do not edit these manually. Use Configure with --prefix or --openssldir
30 # to change this! Short explanation in the top comment in Configure
31 INSTALLTOP
={- # $prefix is used in the OPENSSLDIR perl snippet
33 our
$prefix = $config{prefix} ||
"/usr/local";
36 # The logic here is that if no --openssldir was given,
37 # OPENSSLDIR will get the value from $prefix plus "/ssl".
38 # If --openssldir was given and the value is an absolute
39 # path, OPENSSLDIR will get its value without change.
40 # If the value from --openssldir is a relative path,
41 # OPENSSLDIR will get $prefix with the --openssldir
42 # value appended as a subdirectory.
44 use File
::Spec
::Functions
;
47 (file_name_is_absolute
($config{openssldir
}) ?
49 : catdir
($prefix, $config{openssldir
}))
50 : catdir
($prefix, "ssl");
53 # if $prefix/lib$target{multilib} is not an existing
54 # directory, then assume that it's not searched by linker
55 # automatically, in which case adding $target{multilib} suffix
56 # causes more grief than we're ready to tolerate, so don't...
58 -d
"$prefix/lib$target{multilib}" ?
$target{multilib
} : "";
59 our
$libdir = $config{libdir} ||
"lib$multilib";
61 ENGINESDIR
={- use File
::Spec
::Functions
;
62 catdir
($prefix,$libdir,"engines") -}
64 # NO_IDEA - Define to build without the IDEA algorithm
65 # NO_RC4 - Define to build without the RC4 algorithm
66 # NO_RC2 - Define to build without the RC2 algorithm
67 # THREADS - Define when building with threads, you will probably also need any
68 # system defines as well, i.e. _REENTRANT for Solaris 2.[34]
69 # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
70 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
71 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
72 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
73 # one. 32 bytes will be read from this when the random
74 # number generator is initalised.
75 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
76 # NULL encryption ciphers.
78 # LOCK_DEBUG - turns on lots of lock debug output :-)
79 # REF_DEBUG - turn on some xyz_free() assertions.
80 # REF_PRINT - prints some stuff on structure free.
81 # MFUNC - Make all Malloc/Free/Realloc calls call
82 # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
83 # call application defined callbacks via CRYPTO_set_mem_functions()
84 # MD5_ASM needs to be defined to use the x86 assembler for MD5
85 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
86 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
87 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
89 # PKCS1_CHECK - pkcs1 tests.
91 CROSS_COMPILE
= {- $config{cross_compile_prefix
} -}
92 CC
= $(CROSS_COMPILE
){- $target{cc} -}
93 CFLAG
={- our
$cflags2 = join(" ",(map
{ "-D".
$_} @
{$config{defines
}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $config{cflags} -}
94 CFLAG_Q
={- $cflags2 =~ s|
([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
95 DEPFLAG= {- join(" ",map { "-D
".$_} @{$config{depdefines}}) -}
96 LDFLAG= {- $config{lflags} -}
97 PLIB_LDFLAG= {- $config{plib_lflags} -}
98 EX_LIBS= {- $config{ex_libs} -}
99 EXE_EXT= {- $target{exe_extension} -}
100 ARFLAGS= {- $target{arflags} -}
101 AR=$(CROSS_COMPILE){- $target{ar} -} $(ARFLAGS) r
102 RANLIB= {- $target{ranlib} -}
103 NM= $(CROSS_COMPILE){- $target{nm} -}
104 PERL= {- $config{perl} -}
108 TARFLAGS= --no-recursion
109 MAKEDEPPROG=$(CROSS_COMPILE){- $config{makedepprog} -}
111 # We let the C compiler driver to take care of .s files. This is done in
112 # order to be excused from maintaining a separate set of architecture
113 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
114 # gcc, then the driver will automatically translate it to -xarch=v8plus
115 # and pass it down to assembler.
119 # For x86 assembler: Set PROCESSOR to 386 if you want to support
121 PROCESSOR= {- $config{processor} -}
123 # CPUID module collects small commonly used assembler snippets
124 CPUID_OBJ= {- $target{cpuid_obj} -}
125 BN_ASM= {- $target{bn_obj} -}
126 EC_ASM= {- $target{ec_obj} -}
127 DES_ENC= {- $target{des_obj} -}
128 AES_ENC= {- $target{aes_obj} -}
129 BF_ENC= {- $target{bf_obj} -}
130 CAST_ENC= {- $target{cast_obj} -}
131 RC4_ENC= {- $target{rc4_obj} -}
132 RC5_ENC= {- $target{rc5_obj} -}
133 MD5_ASM_OBJ= {- $target{md5_obj} -}
134 SHA1_ASM_OBJ= {- $target{sha1_obj} -}
135 RMD160_ASM_OBJ= {- $target{rmd160_obj} -}
136 WP_ASM_OBJ= {- $target{wp_obj} -}
137 CMLL_ENC= {- $target{cmll_obj} -}
138 MODES_ASM_OBJ= {- $target{modes_obj} -}
139 PADLOCK_ASM_OBJ= {- $target{padlock_obj} -}
140 CHACHA_ENC= {- $target{chacha_obj} -}
141 POLY1305_ASM_OBJ= {- $target{poly1305_obj} -}
142 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
145 ZLIB_INCLUDE={- $withargs{zlib_include} -}
146 LIBZLIB={- $withargs{zlib_lib} -}
148 # This is the location of fipscanister.o and friends.
149 # The FIPS module build will place it $(INSTALLTOP)/lib
150 # but since $(INSTALLTOP) can only take the default value
151 # when the module is built it will be in /usr/local/ssl/lib
152 # $(INSTALLTOP) for this build may be different so hard
155 FIPSLIBDIR={- $config{fipslibdir} -}
157 # The location of the library which contains fipscanister.o
158 # normally it will be libcrypto. If not compiling in FIPS mode
159 # at all this is empty making it a useful test for a FIPS compile.
161 FIPSCANLIB={- $config{fips} ? "libcrypto
" : "" -}
163 # Shared library base address. Currently only used on Windows.
166 BASEADDR={- $config{baseaddr} -}
168 DIRS= {- join(" ", @{$config{dirs}}) -}
169 SHLIBDIRS= crypto ssl
170 INSTALL_SUBS= engines apps tools
172 # dirs in crypto to build
173 SDIRS= {- join(" ", @{$config{sdirs}}) -}
175 # tests to perform. "alltests
" is a special word indicating that all tests
176 # should be performed.
181 MANDIR=$(INSTALLTOP)/share/man
186 HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
190 LIBS= libcrypto.a libssl.a
191 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
192 SHARED_SSL=libssl$(SHLIB_EXT)
193 SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
194 SHARED_LDFLAG={- $target{shared_ldflag}
195 # Unlike other OSes (like Solaris, Linux, Tru64,
196 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
197 # and FreeBSD) "demand
" RPATH set on .so objects.
198 # Apparently application RPATH is not global and
199 # does not apply to .so linked with other .so.
200 # Problem manifests itself when libssl.so fails to
201 # load libcrypto.so. One can argue that we should
202 # engrave this into Makefile.shared rules or into
203 # BSD-* config lines above. Meanwhile let's try to
204 # be cautious and pass -rpath to linker only when
205 # $prefix is not /usr.
206 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
207 ? " -Wl
,-rpath
,\
$\
$(LIBRPATH
)" : "") -}
208 SHARED_RCFLAG={- $target{shared_rcflag} -}
212 NAME= $(BASENAME)-$(VERSION)
213 TARFILE= ../$(NAME).tar
216 # Directories created on install if they don't exist.
218 $(DESTDIR)$(INSTALLTOP)/bin \
219 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR) \
220 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines \
221 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
222 $(DESTDIR)$(INSTALLTOP)/include/openssl \
223 $(DESTDIR)$(OPENSSLDIR)/misc \
224 $(DESTDIR)$(OPENSSLDIR)/certs \
225 $(DESTDIR)$(OPENSSLDIR)/private
227 all: Makefile build_all_but_tests
229 # as we stick to -e, CLEARENV ensures that local variables in lower
230 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
231 # shell, which [annoyingly enough] terminates unset with error if VAR
232 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
233 # which terminates unset with error if no variable was present:-(
234 CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
235 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
236 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
237 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
239 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
240 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
241 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
242 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
243 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
245 # LC_ALL=C ensures that error [and other] messages are delivered in
246 # same language for uniform treatment.
247 BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
248 CC='$(CC)' CFLAG='$(CFLAG)' CFLAG_Q='$(CFLAG_Q)' \
249 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
250 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
251 CROSS_COMPILE='$(CROSS_COMPILE)' \
253 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
254 DESTDIR='$(DESTDIR)' \
255 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
257 DEPFLAG='$(DEPFLAG)' \
258 SHARED_LDFLAG='$(SHARED_LDFLAG)' \
259 SHARED_RCFLAG='$(SHARED_RCFLAG)' \
260 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
261 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
262 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
264 PLIB_LDFLAG='$(PLIB_LDFLAG)' EX_LIBS='$(EX_LIBS)' \
265 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
266 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
267 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
268 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
269 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
270 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
271 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
272 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
273 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
274 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
275 PADLOCK_ASM_OBJ='$(PADLOCK_ASM_OBJ)' \
276 CHACHA_ENC='$(CHACHA_ENC)' \
277 POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)' \
278 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
279 FIPSLIBDIR='${FIPSLIBDIR}' \
280 FIPSCANLIB="$${FIPSCANLIB
:-$(FIPSCANLIB
)}" \
281 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
282 # MAKEOVERRIDES= effectively "equalizes
" GNU-ish and SysV-ish make flavors,
283 # which in turn eliminates ambiguities in variable treatment with -e.
285 # BUILD_CMD is a generic macro to build a given target in a given
286 # subdirectory. The target must be given through the shell variable
287 # `target' and the subdirectory to build in must be given through `dir'.
288 # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
289 # BUILD_ONE_CMD instead.
291 # RECURSIVE_BUILD_CMD is a macro to build a given target in all
292 # subdirectories defined in $(DIRS). It requires that the target
293 # is given through the shell variable `target'.
295 # BUILD_ONE_CMD is a macro to build a given target in a given
296 # subdirectory if that subdirectory is part of $(DIRS). It requires
297 # exactly the same shell variables as BUILD_CMD.
298 BUILD_CMD= if [ -d "$$dir" ]; then \
299 ( cd $$dir && echo "making
$$target in
$$dir...
" && \
300 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
303 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
305 if expr " $(DIRS
) " : ".
* $$dir " >/dev/null 2>&1; then \
310 @[ -n "$(THIS
)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
314 build_all_but_tests: build_libs build_apps build_tools
315 build_all: build_all_but_tests build_tests
317 build_libs: build_libcrypto build_libssl openssl.pc
319 build_libcrypto: build_crypto build_engines libcrypto.pc
320 build_libssl: build_ssl libssl.pc
323 @dir=crypto; target=all; $(BUILD_ONE_CMD)
324 build_ssl: build_crypto
325 @dir=ssl; target=all; $(BUILD_ONE_CMD)
326 build_engines: build_crypto
327 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
329 build_apps: build_libs
330 @dir=apps; target=all; $(BUILD_ONE_CMD)
331 build_tests: build_libs
332 @dir=test; target=all; $(BUILD_ONE_CMD)
333 build_tools: build_libs
334 @dir=tools; target=all; $(BUILD_ONE_CMD)
336 all_testapps: build_libs build_testapps
338 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
340 libcrypto$(SHLIB_EXT): libcrypto.a
341 @if [ "$(SHLIB_TARGET
)" != "" ]; then \
342 if [ "$(FIPSCANLIB
)" = "libcrypto
" ]; then \
343 FIPSLD_CC="$(CC
)"; CC=fips/fipsld; \
344 export CC FIPSLD_CC; \
346 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC
:-$(CC
)}" build-shared; \
348 echo "There
's no support for shared libraries on this platform" >&2; \
352 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
353 @if [ "$(SHLIB_TARGET)" != "" ]; then \
354 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto
' build-shared; \
356 echo "There's no support for shared libraries on this platform
" >&2; \
361 @ set -e; for i in $(SHLIBDIRS); do \
362 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
363 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
364 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY
)" \
365 symlink.$(SHLIB_TARGET); \
366 libs="$$libs -l
$$i"; \
369 build-shared: do_$(SHLIB_TARGET) link-shared
372 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
373 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
374 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
375 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY
)" \
376 LIBDEPS="$$libs $(EX_LIBS
)" \
377 link_a.$(SHLIB_TARGET); \
378 libs="-l
$$i $$libs"; \
379 case "$(PLATFORM
)" in \
381 rm -f apps/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
382 rm -f test/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
383 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll apps/; \
384 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll test/; \
388 crypto) i=libeay32;; \
391 rm -f apps/$$i.dll; \
392 rm -f test/$$i.dll; \
398 libcrypto.pc: Makefile
399 @ ( echo 'prefix=$(INSTALLTOP)'; \
400 echo 'exec_prefix=$${prefix}'; \
401 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
402 echo 'includedir=$${prefix}/include'; \
404 echo 'Name: OpenSSL-libcrypto'; \
405 echo 'Description: OpenSSL cryptography library'; \
406 echo 'Version: '$(VERSION); \
408 echo 'Libs: -L$${libdir} -lcrypto'; \
409 echo 'Libs.private: $(EX_LIBS)'; \
410 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
413 @ ( echo 'prefix=$(INSTALLTOP)'; \
414 echo 'exec_prefix=$${prefix}'; \
415 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
416 echo 'includedir=$${prefix}/include'; \
418 echo 'Name: OpenSSL-libssl'; \
419 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
420 echo 'Version: '$(VERSION); \
421 echo 'Requires.private: libcrypto'; \
422 echo 'Libs: -L$${libdir} -lssl'; \
423 echo 'Libs.private: $(EX_LIBS)'; \
424 echo 'Cflags: -I$${includedir}' ) > libssl.pc
427 @ ( echo 'prefix=$(INSTALLTOP)'; \
428 echo 'exec_prefix=$${prefix}'; \
429 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
430 echo 'includedir=$${prefix}/include'; \
432 echo 'Name: OpenSSL'; \
433 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
434 echo 'Version: '$(VERSION); \
435 echo 'Requires: libssl libcrypto' ) > openssl.pc
437 Makefile: Makefile.in Configure config
438 @echo "Makefile is older than Makefile.in
, Configure or config.
"
439 @echo "Reconfigure the source tree
(via
'./config' or
'perl Configure'), please.
"
443 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
446 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
447 rm -rf *.bak certs/.0
448 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
449 rm -f $(LIBS) tags TAGS
450 rm -f openssl.pc libssl.pc libcrypto.pc
455 $(PERL) util/mk1mf.pl >makefile.one; \
459 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
460 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
463 @(cd test && echo "generating dummy tests
(if needed
)...
" && \
464 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
467 rehash.time: certs build_apps build_tools
468 @if [ -z "$(CROSS_COMPILE
)" ]; then \
469 (OPENSSL="`pwd`/util
/opensslwrap.sh
"; \
470 [ -x "apps
/openssl.exe
" ] && OPENSSL="apps
/openssl.exe
" || :; \
471 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
472 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
473 $$OPENSSL rehash certs/demo \
474 || $(PERL) tools/c_rehash certs/demo) && \
481 tests: build_tests rehash
482 @(cd test && echo "testing...
" && \
483 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
484 @if [ -z "$(CROSS_COMPILE
)" ]; then \
485 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
490 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
493 @$(PERL) util/selftest.pl
498 -etags `find . -name '*.[ch]' -o -name '*.pm'`
503 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
505 update: generate errors ordinals depend
508 (cd apps && PERL='${PERL}' $(MAKE) generate)
509 (cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
510 (cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
513 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
514 $(PERL) util/mkerr.pl -recurse -write
515 (cd engines; $(MAKE) PERL=$(PERL) errors)
516 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
518 ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
520 $(PERL) util/mkdef.pl crypto update
522 $(PERL) util/mkdef.pl ssl update
524 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
526 TABLE: Configure Configurations/*.conf
527 (echo 'Output of `Configure TABLE'"':"; \
528 $(PERL) Configure TABLE) > TABLE
530 # Build distribution tar-file. As the list of files returned by "find" is
531 # pretty long, on several platforms a "too many arguments" error or similar
532 # would occur. Therefore the list of files is temporarily stored into a file
533 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
534 # tar does not support the --files-from option.
535 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
536 --owner 0 --group 0 \
537 --transform 's|^|
$(NAME
)/|
' \
541 git diff --quiet HEAD
542 git ls-files | sort > $(TARFILE).list
545 find . -type d -print | xargs chmod 755
546 find . -type f -print | xargs chmod a+r
547 find . -type f -perm -0100 -print | xargs chmod a+x
548 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
549 rm -f $(TARFILE).list
552 tar-snap: $(TARFILE).list
553 $(TAR_COMMAND) > $(TARFILE)
554 rm -f $(TARFILE).list
558 $(PERL) Configure dist
559 @$(MAKE) SDIRS='$(SDIRS
)' clean
560 @$(MAKE) TAR='$(TAR
)' TARFLAGS='$(TARFLAGS
)' $(DISTTARVARS) tar
562 install: all install_docs install_sw
564 uninstall: uninstall_sw uninstall_docs
567 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
568 @set -e; for i in include/openssl/*.h; do \
569 (cp $$i $(DESTDIR)$(INSTALLTOP)/$$i; \
570 chmod 644 $(DESTDIR)$(INSTALLTOP)/$$i ); \
572 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
573 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
575 if [ -f "$$i" ]; then \
576 ( echo installing $$i; \
577 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
578 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
579 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
580 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
583 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
584 tmp="$(SHARED_LIBS)"; \
585 for i in $${tmp:-x}; \
587 if [ -f "$$i" -o -f "$$i.a" ]; then \
588 ( echo installing $$i; \
589 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
590 c=`echo $$i | sed 's
/^lib\
(.
*\
)\.dll\.a
/cyg\
1-$(SHLIB_VERSION_NUMBER
).dll
/'`; \
591 cp $$c $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
592 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
593 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$c.new $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
594 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
595 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
596 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
598 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
599 chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
600 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
602 if expr $(PLATFORM) : 'mingw
' > /dev/null; then \
604 *crypto*) i=libeay32.dll;; \
605 *ssl*) i=ssleay32.dll;; \
607 echo installing $$i; \
608 cp $$i $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
609 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
610 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$i.new $(DESTDIR)$(INSTALLTOP)/bin/$$i ); \
615 cd $(DESTDIR)$(INSTALLTOP)/$(LIBDIR); \
616 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
617 if [ "$(INSTALLTOP)" != "/usr" ]; then \
618 echo 'OpenSSL shared libraries have been installed in
:'; \
619 echo ' $(INSTALLTOP
)'; \
622 cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
623 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
624 cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
625 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
626 cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
627 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
630 cd include/openssl && files=* && cd $(DESTDIR)$(INSTALLTOP)/include/openssl && $(RM) $$files
634 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i && \
635 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
637 @if [ -n "$(SHARED_LIBS)" ]; then \
638 tmp="$(SHARED_LIBS)"; \
639 for i in $${tmp:-x}; \
641 if [ -f "$$i" -o -f "$$i.a" ]; then \
642 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
643 c=`echo $$i | sed 's
/^lib\
(.
*\
)\.dll\.a
/cyg\
1-$(SHLIB_VERSION_NUMBER
).dll
/'`; \
644 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
645 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
646 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
647 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
649 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
650 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
652 if expr $(PLATFORM) : 'mingw
' > /dev/null; then \
654 *crypto*) i=libeay32.dll;; \
655 *ssl*) i=ssleay32.dll;; \
657 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
658 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
663 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
664 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
665 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
666 @target=uninstall; $(RECURSIVE_BUILD_CMD)
671 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
674 for subdir in apps crypto ssl; do \
675 $(PERL) $(TOP)/util/mkdir-p $(DESTDIR)$(HTMLDIR)/$$subdir; \
676 for i in doc/$$subdir/*.pod; do \
677 fn=`basename $$i .pod`; \
678 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
680 | sed -r 's
/L
<([^
)]*)(\
([0-9]\
))?\|
([^
)]*)(\
([0-9]\
))?
>/L
<\
1|\
3>/g
' \
681 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
682 | sed -r 's
/<!DOCTYPE.
*//g
' \
683 > $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
684 $(PERL) util/extract-names.pl < $$i | \
685 grep -v $$filecase "^$$fn\$$" | \
686 (cd $(DESTDIR)$(HTMLDIR)/$$subdir; \
688 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
696 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
699 for subdir in apps crypto ssl; do \
700 for i in doc/$$subdir/*.pod; do \
701 fn=`basename $$i .pod`; \
702 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
703 $(PERL) util/extract-names.pl < $$i | \
704 grep -v $$filecase "^$$fn\$$" | \
706 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
712 @$(PERL) $(TOP)/util/mkdir-p.pl \
713 $(DESTDIR)$(MANDIR)/man1 \
714 $(DESTDIR)$(MANDIR)/man3 \
715 $(DESTDIR)$(MANDIR)/man5 \
716 $(DESTDIR)$(MANDIR)/man7
719 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
722 set -e; for i in doc/apps/*.pod; do \
723 fn=`basename $$i .pod`; \
724 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
725 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
726 (cd `$(PERL) util/dirname.pl $$i`; \
728 --section=$$sec --center=OpenSSL \
729 --release=$(VERSION) `basename $$i`) \
730 > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
731 $(PERL) util/extract-names.pl < $$i | \
732 (grep -v $$filecase "^$$fn\$$"; true) | \
733 (grep -v "[ ]"; true) | \
734 (cd $(DESTDIR)$(MANDIR)/man$$sec/; \
736 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
739 set -e; 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 "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
743 (cd `$(PERL) util/dirname.pl $$i`; \
745 --section=$$sec --center=OpenSSL \
746 --release=$(VERSION) `basename $$i`) \
747 > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
748 $(PERL) util/extract-names.pl < $$i | \
749 (grep -v $$filecase "^$$fn\$$"; true) | \
750 (grep -v "[ ]"; true) | \
751 (cd $(DESTDIR)$(MANDIR)/man$$sec/; \
753 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
760 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
763 for i in doc/apps/*.pod; do \
764 fn=`basename $$i .pod`; \
765 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
766 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
767 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
768 $(PERL) util/extract-names.pl < $$i | \
769 (grep -v $$filecase "^$$fn\$$"; true) | \
770 (grep -v "[ ]"; true) | \
772 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
773 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
776 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
777 fn=`basename $$i .pod`; \
778 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
779 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
780 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
781 $(PERL) util/extract-names.pl < $$i | \
782 (grep -v $$filecase "^$$fn\$$"; true) | \
783 (grep -v "[ ]"; true) | \
785 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
786 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
790 # DO NOT DELETE THIS LINE -- make depend depends on it.