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 # 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.
27 INSTALL_PREFIX={- $config{install_prefix} -}
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_CHECK - 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={- join(" ",(map { "-D".$_} @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $config{cflags} -}
94 DEPFLAG= {- join(" ",map { "-D".$_} @{$config{depdefines}}) -}
95 LDFLAG= {- $config{lflags} -}
96 PLIB_LDFLAG= {- $config{plib_lflags} -}
97 EX_LIBS= {- $config{ex_libs} -}
98 EXE_EXT= {- $target{exe_extension} -}
99 ARFLAGS= {- $target{arflags} -}
100 AR=$(CROSS_COMPILE){- $target{ar} -} $(ARFLAGS) r
101 RANLIB= {- $target{ranlib} -}
102 NM= $(CROSS_COMPILE){- $target{nm} -}
103 PERL= {- $config{perl} -}
107 TARFLAGS= --no-recursion
108 MAKEDEPPROG=$(CROSS_COMPILE){- $config{makedepprog} -}
110 # We let the C compiler driver to take care of .s files. This is done in
111 # order to be excused from maintaining a separate set of architecture
112 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
113 # gcc, then the driver will automatically translate it to -xarch=v8plus
114 # and pass it down to assembler.
118 # For x86 assembler: Set PROCESSOR to 386 if you want to support
120 PROCESSOR= {- $config{processor} -}
122 # CPUID module collects small commonly used assembler snippets
123 CPUID_OBJ= {- $target{cpuid_obj} -}
124 BN_ASM= {- $target{bn_obj} -}
125 EC_ASM= {- $target{ec_obj} -}
126 DES_ENC= {- $target{des_obj} -}
127 AES_ENC= {- $target{aes_obj} -}
128 BF_ENC= {- $target{bf_obj} -}
129 CAST_ENC= {- $target{cast_obj} -}
130 RC4_ENC= {- $target{rc4_obj} -}
131 RC5_ENC= {- $target{rc5_obj} -}
132 MD5_ASM_OBJ= {- $target{md5_obj} -}
133 SHA1_ASM_OBJ= {- $target{sha1_obj} -}
134 RMD160_ASM_OBJ= {- $target{rmd160_obj} -}
135 WP_ASM_OBJ= {- $target{wp_obj} -}
136 CMLL_ENC= {- $target{cmll_obj} -}
137 MODES_ASM_OBJ= {- $target{modes_obj} -}
138 PADLOCK_ASM_OBJ= {- $target{padlock_obj} -}
139 CHACHA_ENC= {- $target{chacha_obj} -}
140 POLY1305_ASM_OBJ= {- $target{poly1305_obj} -}
141 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
144 ZLIB_INCLUDE={- $withargs{zlib_include} -}
145 LIBZLIB={- $withargs{zlib_lib} -}
147 # This is the location of fipscanister.o and friends.
148 # The FIPS module build will place it $(INSTALLTOP)/lib
149 # but since $(INSTALLTOP) can only take the default value
150 # when the module is built it will be in /usr/local/ssl/lib
151 # $(INSTALLTOP) for this build may be different so hard
154 FIPSLIBDIR={- $config{fipslibdir} -}
156 # The location of the library which contains fipscanister.o
157 # normally it will be libcrypto. If not compiling in FIPS mode
158 # at all this is empty making it a useful test for a FIPS compile.
160 FIPSCANLIB={- $config{fips} ? "libcrypto" : "" -}
162 # Shared library base address. Currently only used on Windows.
165 BASEADDR={- $config{baseaddr} -}
167 DIRS= {- join(" ", @{$config{dirs}}) -}
168 SHLIBDIRS= crypto ssl
169 INSTALL_SUBS= engines apps tools
171 # dirs in crypto to build
172 SDIRS= {- join(" ", @{$config{sdirs}}) -}
174 # tests to perform. "alltests" is a special word indicating that all tests
175 # should be performed.
180 MANDIR=$(INSTALLTOP)/share/man
185 HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html
189 LIBS= libcrypto.a libssl.a
190 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
191 SHARED_SSL=libssl$(SHLIB_EXT)
192 SHARED_LIBS={- '$(SHARED_CRYPTO) $(SHARED_SSL)' if (!$config{no_shared}) -}
193 SHARED_LDFLAG={- $target{shared_ldflag}
194 # Unlike other OSes (like Solaris, Linux, Tru64,
195 # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD
196 # and FreeBSD) "demand" RPATH set on .so objects.
197 # Apparently application RPATH is not global and
198 # does not apply to .so linked with other .so.
199 # Problem manifests itself when libssl.so fails to
200 # load libcrypto.so. One can argue that we should
201 # engrave this into Makefile.shared rules or into
202 # BSD-* config lines above. Meanwhile let's try to
203 # be cautious and pass -rpath to linker only when
204 # $prefix is not /usr.
205 . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$|
206 ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -}
210 NAME= $(BASENAME)-$(VERSION)
211 TARFILE= ../$(NAME).tar
214 # Directories created on install if they don't exist.
216 $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
217 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
218 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
219 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
220 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
221 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
222 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
223 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
225 all: Makefile build_all
227 # as we stick to -e, CLEARENV ensures that local variables in lower
228 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
229 # shell, which [annoyingly enough] terminates unset with error if VAR
230 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
231 # which terminates unset with error if no variable was present:-(
232 CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
233 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
234 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
235 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
237 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
238 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
239 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
240 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
241 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
243 # LC_ALL=C ensures that error [and other] messages are delivered in
244 # same language for uniform treatment.
245 BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
246 CC='$(CC)' CFLAG='$(CFLAG)' \
247 AS='$(CC)' ASFLAG='$(CFLAG) -c' \
248 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
249 CROSS_COMPILE='$(CROSS_COMPILE)' \
251 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
252 INSTALL_PREFIX='$(INSTALL_PREFIX)' \
253 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
255 DEPFLAG='$(DEPFLAG)' \
256 SHARED_LDFLAG='$(SHARED_LDFLAG)' \
257 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
258 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
259 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
261 PLIB_LDFLAG='$(PLIB_LDFLAG)' EX_LIBS='$(EX_LIBS)' \
262 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \
263 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \
264 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
265 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
266 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
267 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
268 MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
269 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
270 WP_ASM_OBJ='$(WP_ASM_OBJ)' \
271 MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
272 PADLOCK_ASM_OBJ='$(PADLOCK_ASM_OBJ)' \
273 CHACHA_ENC='$(CHACHA_ENC)' \
274 POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)' \
275 PERLASM_SCHEME='$(PERLASM_SCHEME)' \
276 FIPSLIBDIR='${FIPSLIBDIR}' \
277 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
278 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
279 # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
280 # which in turn eliminates ambiguities in variable treatment with -e.
282 # BUILD_CMD is a generic macro to build a given target in a given
283 # subdirectory. The target must be given through the shell variable
284 # `target' and the subdirectory to build in must be given through `dir'.
285 # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
286 # BUILD_ONE_CMD instead.
288 # RECURSIVE_BUILD_CMD is a macro to build a given target in all
289 # subdirectories defined in $(DIRS). It requires that the target
290 # is given through the shell variable `target'.
292 # BUILD_ONE_CMD is a macro to build a given target in a given
293 # subdirectory if that subdirectory is part of $(DIRS). It requires
294 # exactly the same shell variables as BUILD_CMD.
295 BUILD_CMD= if [ -d "$$dir" ]; then \
296 ( cd $$dir && echo "making $$target in $$dir..." && \
297 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
300 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
302 if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
307 @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
311 build_all: build_libs build_apps build_tests build_tools
313 build_libs: build_libcrypto build_libssl openssl.pc
315 build_libcrypto: build_crypto build_engines libcrypto.pc
316 build_libssl: build_ssl libssl.pc
319 @dir=crypto; target=all; $(BUILD_ONE_CMD)
320 build_ssl: build_crypto
321 @dir=ssl; target=all; $(BUILD_ONE_CMD)
322 build_engines: build_crypto
323 @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
325 build_apps: build_libs
326 @dir=apps; target=all; $(BUILD_ONE_CMD)
327 build_tests: build_libs
328 @dir=test; target=all; $(BUILD_ONE_CMD)
329 build_tools: build_libs
330 @dir=tools; target=all; $(BUILD_ONE_CMD)
332 all_testapps: build_libs build_testapps
334 @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
336 libcrypto$(SHLIB_EXT): libcrypto.a
337 @if [ "$(SHLIB_TARGET)" != "" ]; then \
338 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
339 FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
340 export CC FIPSLD_CC; \
342 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \
344 echo "There's no support for shared libraries on this platform" >&2; \
348 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
349 @if [ "$(SHLIB_TARGET)" != "" ]; then \
350 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
352 echo "There's no support for shared libraries on this platform" >&2; \
357 @ set -e; for i in $(SHLIBDIRS); do \
358 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
359 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
360 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
361 symlink.$(SHLIB_TARGET); \
362 libs="$$libs -l$$i"; \
365 build-shared: do_$(SHLIB_TARGET) link-shared
368 @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
369 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
370 LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
371 LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
372 LIBDEPS="$$libs $(EX_LIBS)" \
373 link_a.$(SHLIB_TARGET); \
374 libs="-l$$i $$libs"; \
375 case "$(PLATFORM)" in \
377 rm -f apps/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
378 rm -f test/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \
379 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll apps/; \
380 cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll test/; \
384 crypto) i=libeay32;; \
387 rm -f apps/$$i.dll; \
388 rm -f test/$$i.dll; \
394 libcrypto.pc: Makefile
395 @ ( echo 'prefix=$(INSTALLTOP)'; \
396 echo 'exec_prefix=$${prefix}'; \
397 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
398 echo 'includedir=$${prefix}/include'; \
400 echo 'Name: OpenSSL-libcrypto'; \
401 echo 'Description: OpenSSL cryptography library'; \
402 echo 'Version: '$(VERSION); \
404 echo 'Libs: -L$${libdir} -lcrypto'; \
405 echo 'Libs.private: $(EX_LIBS)'; \
406 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
409 @ ( echo 'prefix=$(INSTALLTOP)'; \
410 echo 'exec_prefix=$${prefix}'; \
411 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
412 echo 'includedir=$${prefix}/include'; \
414 echo 'Name: OpenSSL-libssl'; \
415 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
416 echo 'Version: '$(VERSION); \
417 echo 'Requires.private: libcrypto'; \
418 echo 'Libs: -L$${libdir} -lssl'; \
419 echo 'Libs.private: $(EX_LIBS)'; \
420 echo 'Cflags: -I$${includedir}' ) > libssl.pc
423 @ ( echo 'prefix=$(INSTALLTOP)'; \
424 echo 'exec_prefix=$${prefix}'; \
425 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
426 echo 'includedir=$${prefix}/include'; \
428 echo 'Name: OpenSSL'; \
429 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
430 echo 'Version: '$(VERSION); \
431 echo 'Requires: libssl libcrypto' ) > openssl.pc
433 Makefile: Makefile.in Configure config
434 @echo "Makefile is older than Makefile.in, Configure or config."
435 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
439 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
442 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
443 rm -rf *.bak certs/.0
444 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
445 rm -f $(LIBS) tags TAGS
446 rm -f openssl.pc libssl.pc libcrypto.pc
451 $(PERL) util/mk1mf.pl >makefile.one; \
455 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
456 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
459 @(cd test && echo "generating dummy tests (if needed)..." && \
460 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
463 rehash.time: certs build_apps build_tools
464 @if [ -z "$(CROSS_COMPILE)" ]; then \
465 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
466 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
467 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
468 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
469 $$OPENSSL rehash certs/demo \
470 || $(PERL) tools/c_rehash certs/demo) && \
478 @(cd test && echo "testing..." && \
479 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
480 @if [ -z "$(CROSS_COMPILE)" ]; then \
481 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
486 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
489 @$(PERL) util/selftest.pl
494 -etags `find . -name '*.[ch]' -o -name '*.pm'`
499 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
501 update: generate errors ordinals depend
504 (cd apps && PERL='${PERL}' $(MAKE) generate)
505 (cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
506 (cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
509 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
510 $(PERL) util/mkerr.pl -recurse -write
511 (cd engines; $(MAKE) PERL=$(PERL) errors)
512 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
514 ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
516 $(PERL) util/mkdef.pl crypto update
518 $(PERL) util/mkdef.pl ssl update
520 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
522 TABLE: Configure Configurations/*.conf
523 (echo 'Output of `Configure TABLE'"':"; \
524 $(PERL) Configure TABLE) > TABLE
526 # Build distribution tar-file. As the list of files returned by "find" is
527 # pretty long, on several platforms a "too many arguments" error or similar
528 # would occur. Therefore the list of files is temporarily stored into a file
529 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
530 # tar does not support the --files-from option.
531 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
532 --owner 0 --group 0 \
533 --transform 's|^|$(NAME)/|' \
537 git diff --quiet HEAD
538 git ls-files | sort > $(TARFILE).list
541 find . -type d -print | xargs chmod 755
542 find . -type f -print | xargs chmod a+r
543 find . -type f -perm -0100 -print | xargs chmod a+x
544 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
545 rm -f $(TARFILE).list
548 tar-snap: $(TARFILE).list
549 $(TAR_COMMAND) > $(TARFILE)
550 rm -f $(TARFILE).list
554 $(PERL) Configure dist
555 @$(MAKE) SDIRS='$(SDIRS)' clean
556 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
558 install: all install_docs install_sw
560 uninstall: uninstall_sw uninstall_docs
563 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
564 @set -e; for i in include/openssl/*.h; do \
565 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
566 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
568 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
569 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
571 if [ -f "$$i" ]; then \
572 ( echo installing $$i; \
573 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
574 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
575 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
576 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
579 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
580 tmp="$(SHARED_LIBS)"; \
581 for i in $${tmp:-x}; \
583 if [ -f "$$i" -o -f "$$i.a" ]; then \
584 ( echo installing $$i; \
585 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
586 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
587 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
588 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
589 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
590 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
591 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
592 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
594 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
595 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
596 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
598 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
600 *crypto*) i=libeay32.dll;; \
601 *ssl*) i=ssleay32.dll;; \
603 echo installing $$i; \
604 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
605 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
606 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
611 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
612 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
613 if [ "$(INSTALLTOP)" != "/usr" ]; then \
614 echo 'OpenSSL shared libraries have been installed in:'; \
615 echo ' $(INSTALLTOP)'; \
618 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
619 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
620 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
621 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
622 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
623 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
626 cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
630 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
631 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
633 @if [ -n "$(SHARED_LIBS)" ]; then \
634 tmp="$(SHARED_LIBS)"; \
635 for i in $${tmp:-x}; \
637 if [ -f "$$i" -o -f "$$i.a" ]; then \
638 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
639 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
640 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
641 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
642 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
643 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
645 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
646 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
648 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
650 *crypto*) i=libeay32.dll;; \
651 *ssl*) i=ssleay32.dll;; \
653 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
654 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
659 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
660 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
661 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
662 @target=uninstall; $(RECURSIVE_BUILD_CMD)
667 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
670 for subdir in apps crypto ssl; do \
671 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
672 for i in doc/$$subdir/*.pod; do \
673 fn=`basename $$i .pod`; \
674 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
676 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
677 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
678 | sed -r 's/<!DOCTYPE.*//g' \
679 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
680 $(PERL) util/extract-names.pl < $$i | \
681 grep -v $$filecase "^$$fn\$$" | \
682 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
684 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
692 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
695 for subdir in apps crypto ssl; do \
696 for i in doc/$$subdir/*.pod; do \
697 fn=`basename $$i .pod`; \
698 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
699 $(PERL) util/extract-names.pl < $$i | \
700 grep -v $$filecase "^$$fn\$$" | \
702 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
708 @$(PERL) $(TOP)/util/mkdir-p.pl \
709 $(INSTALL_PREFIX)$(MANDIR)/man1 \
710 $(INSTALL_PREFIX)$(MANDIR)/man3 \
711 $(INSTALL_PREFIX)$(MANDIR)/man5 \
712 $(INSTALL_PREFIX)$(MANDIR)/man7
715 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
718 set -e; for i in doc/apps/*.pod; do \
719 fn=`basename $$i .pod`; \
720 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
721 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
722 (cd `$(PERL) util/dirname.pl $$i`; \
724 --section=$$sec --center=OpenSSL \
725 --release=$(VERSION) `basename $$i`) \
726 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
727 $(PERL) util/extract-names.pl < $$i | \
728 (grep -v $$filecase "^$$fn\$$"; true) | \
729 (grep -v "[ ]"; true) | \
730 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
732 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
735 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
736 fn=`basename $$i .pod`; \
737 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
738 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
739 (cd `$(PERL) util/dirname.pl $$i`; \
741 --section=$$sec --center=OpenSSL \
742 --release=$(VERSION) `basename $$i`) \
743 > $(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 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
749 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
756 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
759 for i in doc/apps/*.pod; do \
760 fn=`basename $$i .pod`; \
761 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
762 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
763 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
764 $(PERL) util/extract-names.pl < $$i | \
765 (grep -v $$filecase "^$$fn\$$"; true) | \
766 (grep -v "[ ]"; true) | \
768 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
769 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
772 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
773 fn=`basename $$i .pod`; \
774 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
775 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
776 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
777 $(PERL) util/extract-names.pl < $$i | \
778 (grep -v $$filecase "^$$fn\$$"; true) | \
779 (grep -v "[ ]"; true) | \
781 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
782 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
786 # DO NOT DELETE THIS LINE -- make depend depends on it.