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 crypto) i=libeay32;; \
395 rm -f apps/$$i.dll; \
396 rm -f test/$$i.dll; \
402 libcrypto.pc: Makefile
403 @ ( echo 'prefix=$(INSTALLTOP)'; \
404 echo 'exec_prefix=$${prefix}'; \
405 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
406 echo 'includedir=$${prefix}/include'; \
408 echo 'Name: OpenSSL-libcrypto'; \
409 echo 'Description: OpenSSL cryptography library'; \
410 echo 'Version: '$(VERSION); \
412 echo 'Libs: -L$${libdir} -lcrypto'; \
413 echo 'Libs.private: $(EX_LIBS)'; \
414 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
417 @ ( echo 'prefix=$(INSTALLTOP)'; \
418 echo 'exec_prefix=$${prefix}'; \
419 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
420 echo 'includedir=$${prefix}/include'; \
422 echo 'Name: OpenSSL-libssl'; \
423 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
424 echo 'Version: '$(VERSION); \
425 echo 'Requires.private: libcrypto'; \
426 echo 'Libs: -L$${libdir} -lssl'; \
427 echo 'Libs.private: $(EX_LIBS)'; \
428 echo 'Cflags: -I$${includedir}' ) > libssl.pc
431 @ ( echo 'prefix=$(INSTALLTOP)'; \
432 echo 'exec_prefix=$${prefix}'; \
433 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
434 echo 'includedir=$${prefix}/include'; \
436 echo 'Name: OpenSSL'; \
437 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
438 echo 'Version: '$(VERSION); \
439 echo 'Requires: libssl libcrypto' ) > openssl.pc
441 Makefile: Makefile.in Configure config
442 @echo "Makefile is older than Makefile.in, Configure or config."
443 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
447 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
450 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
451 rm -rf *.bak certs/.0
452 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
453 rm -f $(LIBS) tags TAGS
454 rm -f openssl.pc libssl.pc libcrypto.pc
459 $(PERL) util/mk1mf.pl >makefile.one; \
463 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
464 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
467 @(cd test && echo "generating dummy tests (if needed)..." && \
468 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
471 rehash.time: certs build_apps build_tools
472 @if [ -z "$(CROSS_COMPILE)" ]; then \
473 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
474 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
475 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
476 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
477 $$OPENSSL rehash certs/demo \
478 || $(PERL) tools/c_rehash certs/demo) && \
485 tests: build_tests rehash
486 @(cd test && echo "testing..." && \
487 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
488 @if [ -z "$(CROSS_COMPILE)" ]; then \
489 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
494 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
497 @$(PERL) util/selftest.pl
502 -etags `find . -name '*.[ch]' -o -name '*.pm'`
507 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
509 update: generate errors ordinals depend
512 (cd apps && PERL='${PERL}' $(MAKE) generate)
513 (cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
514 (cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
517 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
518 $(PERL) util/mkerr.pl -recurse -write
519 (cd engines; $(MAKE) PERL=$(PERL) errors)
520 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
522 ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
524 $(PERL) util/mkdef.pl crypto update
526 $(PERL) util/mkdef.pl ssl update
528 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
530 TABLE: Configure Configurations/*.conf
531 (echo 'Output of `Configure TABLE'"':"; \
532 $(PERL) Configure TABLE) > TABLE
534 # Build distribution tar-file. As the list of files returned by "find" is
535 # pretty long, on several platforms a "too many arguments" error or similar
536 # would occur. Therefore the list of files is temporarily stored into a file
537 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
538 # tar does not support the --files-from option.
539 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
540 --owner 0 --group 0 \
541 --transform 's|^|$(NAME)/|' \
545 git diff --quiet HEAD
546 git ls-files | sort > $(TARFILE).list
549 find . -type d -print | xargs chmod 755
550 find . -type f -print | xargs chmod a+r
551 find . -type f -perm -0100 -print | xargs chmod a+x
552 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
553 rm -f $(TARFILE).list
556 tar-snap: $(TARFILE).list
557 $(TAR_COMMAND) > $(TARFILE)
558 rm -f $(TARFILE).list
562 $(PERL) Configure dist
563 @$(MAKE) SDIRS='$(SDIRS)' clean
564 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
566 install: all install_docs install_sw
568 uninstall: uninstall_sw uninstall_docs
571 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
572 @set -e; for i in include/openssl/*.h; do \
573 (cp $$i $(DESTDIR)$(INSTALLTOP)/$$i; \
574 chmod 644 $(DESTDIR)$(INSTALLTOP)/$$i ); \
576 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
577 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
579 if [ -f "$$i" ]; then \
580 ( echo installing $$i; \
581 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
582 $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
583 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
584 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
587 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
588 tmp="$(SHARED_LIBS)"; \
589 for i in $${tmp:-x}; \
591 if [ -f "$$i" -o -f "$$i.a" ]; then \
592 ( echo installing $$i; \
593 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
594 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
595 cp $$c $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
596 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \
597 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$c.new $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
598 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
599 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
600 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
602 cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
603 chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
604 mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
606 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
608 *crypto*) i=libeay32.dll;; \
609 *ssl*) i=ssleay32.dll;; \
611 echo installing $$i; \
612 cp $$i $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
613 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$i.new; \
614 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$i.new $(DESTDIR)$(INSTALLTOP)/bin/$$i ); \
619 cd $(DESTDIR)$(INSTALLTOP)/$(LIBDIR); \
620 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
621 if [ "$(INSTALLTOP)" != "/usr" ]; then \
622 echo 'OpenSSL shared libraries have been installed in:'; \
623 echo ' $(INSTALLTOP)'; \
626 cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
627 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
628 cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
629 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
630 cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
631 chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
634 cd include/openssl && files=* && cd $(DESTDIR)$(INSTALLTOP)/include/openssl && $(RM) $$files
638 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i && \
639 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
641 @if [ -n "$(SHARED_LIBS)" ]; then \
642 tmp="$(SHARED_LIBS)"; \
643 for i in $${tmp:-x}; \
645 if [ -f "$$i" -o -f "$$i.a" ]; then \
646 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
647 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
648 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
649 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \
650 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
651 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
653 echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
654 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \
656 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
658 *crypto*) i=libeay32.dll;; \
659 *ssl*) i=ssleay32.dll;; \
661 echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
662 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$i; \
667 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
668 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
669 $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
670 @target=uninstall; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
675 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
678 for subdir in apps crypto ssl; do \
679 $(PERL) $(TOP)/util/mkdir-p $(DESTDIR)$(HTMLDIR)/$$subdir; \
680 for i in doc/$$subdir/*.pod; do \
681 fn=`basename $$i .pod`; \
682 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
684 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
685 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
686 | sed -r 's/<!DOCTYPE.*//g' \
687 > $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
688 $(PERL) util/extract-names.pl < $$i | \
689 grep -v $$filecase "^$$fn\$$" | \
690 (cd $(DESTDIR)$(HTMLDIR)/$$subdir; \
692 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
700 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
703 for subdir in apps crypto ssl; do \
704 for i in doc/$$subdir/*.pod; do \
705 fn=`basename $$i .pod`; \
706 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
707 $(PERL) util/extract-names.pl < $$i | \
708 grep -v $$filecase "^$$fn\$$" | \
710 $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
716 @$(PERL) $(TOP)/util/mkdir-p.pl \
717 $(DESTDIR)$(MANDIR)/man1 \
718 $(DESTDIR)$(MANDIR)/man3 \
719 $(DESTDIR)$(MANDIR)/man5 \
720 $(DESTDIR)$(MANDIR)/man7
723 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
726 set -e; for i in doc/apps/*.pod; do \
727 fn=`basename $$i .pod`; \
728 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
729 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
730 (cd `$(PERL) util/dirname.pl $$i`; \
732 --section=$$sec --center=OpenSSL \
733 --release=$(VERSION) `basename $$i`) \
734 > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
735 $(PERL) util/extract-names.pl < $$i | \
736 (grep -v $$filecase "^$$fn\$$"; true) | \
737 (grep -v "[ ]"; true) | \
738 (cd $(DESTDIR)$(MANDIR)/man$$sec/; \
740 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
743 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
744 fn=`basename $$i .pod`; \
745 sec=`$(PERL) util/extract-section.pl 3 < $$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); \
764 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
767 for i in doc/apps/*.pod; do \
768 fn=`basename $$i .pod`; \
769 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
770 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
771 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
772 $(PERL) util/extract-names.pl < $$i | \
773 (grep -v $$filecase "^$$fn\$$"; true) | \
774 (grep -v "[ ]"; true) | \
776 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
777 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
780 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
781 fn=`basename $$i .pod`; \
782 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
783 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
784 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
785 $(PERL) util/extract-names.pl < $$i | \
786 (grep -v $$filecase "^$$fn\$$"; true) | \
787 (grep -v "[ ]"; true) | \
789 echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
790 $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
794 # DO NOT DELETE THIS LINE -- make depend depends on it.