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"; \
377 libcrypto.pc: Makefile
378 @ ( echo 'prefix=$(INSTALLTOP)'; \
379 echo 'exec_prefix=$${prefix}'; \
380 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
381 echo 'includedir=$${prefix}/include'; \
383 echo 'Name: OpenSSL-libcrypto'; \
384 echo 'Description: OpenSSL cryptography library'; \
385 echo 'Version: '$(VERSION); \
387 echo 'Libs: -L$${libdir} -lcrypto'; \
388 echo 'Libs.private: $(EX_LIBS)'; \
389 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
392 @ ( echo 'prefix=$(INSTALLTOP)'; \
393 echo 'exec_prefix=$${prefix}'; \
394 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
395 echo 'includedir=$${prefix}/include'; \
397 echo 'Name: OpenSSL-libssl'; \
398 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
399 echo 'Version: '$(VERSION); \
400 echo 'Requires.private: libcrypto'; \
401 echo 'Libs: -L$${libdir} -lssl'; \
402 echo 'Libs.private: $(EX_LIBS)'; \
403 echo 'Cflags: -I$${includedir}' ) > libssl.pc
406 @ ( echo 'prefix=$(INSTALLTOP)'; \
407 echo 'exec_prefix=$${prefix}'; \
408 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
409 echo 'includedir=$${prefix}/include'; \
411 echo 'Name: OpenSSL'; \
412 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
413 echo 'Version: '$(VERSION); \
414 echo 'Requires: libssl libcrypto' ) > openssl.pc
416 Makefile: Makefile.in Configure config
417 @echo "Makefile is older than Makefile.in, Configure or config."
418 @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
422 rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
425 rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
426 rm -rf *.bak certs/.0
427 @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
428 rm -f $(LIBS) tags TAGS
429 rm -f openssl.pc libssl.pc libcrypto.pc
434 $(PERL) util/mk1mf.pl >makefile.one; \
438 $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
439 @set -e; target=files; $(RECURSIVE_BUILD_CMD)
442 @(cd test && echo "generating dummy tests (if needed)..." && \
443 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
446 rehash.time: certs build_apps build_tools
447 @if [ -z "$(CROSS_COMPILE)" ]; then \
448 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
449 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
450 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
451 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
452 $$OPENSSL rehash certs/demo \
453 || $(PERL) tools/c_rehash certs/demo) && \
461 @(cd test && echo "testing..." && \
462 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
463 @if [ -z "$(CROSS_COMPILE)" ]; then \
464 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
469 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
472 @$(PERL) util/selftest.pl
477 -etags `find . -name '*.[ch]' -o -name '*.pm'`
482 @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
484 update: generate errors ordinals depend
487 (cd apps && PERL='${PERL}' $(MAKE) generate)
488 (cd crypto/bn && PERL='${PERL}' $(MAKE) generate)
489 (cd crypto/objects && PERL='${PERL}' $(MAKE) generate)
492 $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
493 $(PERL) util/mkerr.pl -recurse -write
494 (cd engines; $(MAKE) PERL=$(PERL) errors)
495 (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
497 ordinals: util/libeay.num util/ssleay.num test_ordinals TABLE
499 $(PERL) util/mkdef.pl crypto update
501 $(PERL) util/mkdef.pl ssl update
503 TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
505 TABLE: Configure Configurations/*.conf
506 (echo 'Output of `Configure TABLE'"':"; \
507 $(PERL) Configure TABLE) > TABLE
509 # Build distribution tar-file. As the list of files returned by "find" is
510 # pretty long, on several platforms a "too many arguments" error or similar
511 # would occur. Therefore the list of files is temporarily stored into a file
512 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
513 # tar does not support the --files-from option.
514 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
515 --owner 0 --group 0 \
516 --transform 's|^|$(NAME)/|' \
520 git diff --quiet HEAD
521 git ls-files | sort > $(TARFILE).list
524 find . -type d -print | xargs chmod 755
525 find . -type f -print | xargs chmod a+r
526 find . -type f -perm -0100 -print | xargs chmod a+x
527 $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
528 rm -f $(TARFILE).list
531 tar-snap: $(TARFILE).list
532 $(TAR_COMMAND) > $(TARFILE)
533 rm -f $(TARFILE).list
537 $(PERL) Configure dist
538 @$(MAKE) SDIRS='$(SDIRS)' clean
539 @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
541 install: all install_docs install_sw
543 uninstall: uninstall_sw uninstall_docs
546 @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
547 @set -e; for i in include/openssl/*.h; do \
548 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
549 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
551 @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
552 @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
554 if [ -f "$$i" ]; then \
555 ( echo installing $$i; \
556 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
557 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
558 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
559 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
562 @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
563 tmp="$(SHARED_LIBS)"; \
564 for i in $${tmp:-x}; \
566 if [ -f "$$i" -o -f "$$i.a" ]; then \
567 ( echo installing $$i; \
568 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
569 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
570 cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
571 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
572 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
573 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
574 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
575 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
577 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
578 chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
579 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
581 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
583 *crypto*) i=libeay32.dll;; \
584 *ssl*) i=ssleay32.dll;; \
586 echo installing $$i; \
587 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
588 chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
589 mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
594 cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
595 $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
596 if [ "$(INSTALLTOP)" != "/usr" ]; then \
597 echo 'OpenSSL shared libraries have been installed in:'; \
598 echo ' $(INSTALLTOP)'; \
601 cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
602 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
603 cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
604 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
605 cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
606 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
609 cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
613 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
614 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
616 @if [ -n "$(SHARED_LIBS)" ]; then \
617 tmp="$(SHARED_LIBS)"; \
618 for i in $${tmp:-x}; \
620 if [ -f "$$i" -o -f "$$i.a" ]; then \
621 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
622 c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
623 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
624 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
625 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
626 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
628 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
629 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
631 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
633 *crypto*) i=libeay32.dll;; \
634 *ssl*) i=ssleay32.dll;; \
636 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
637 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
642 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
643 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
644 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
645 @target=uninstall; $(RECURSIVE_BUILD_CMD)
650 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
653 for subdir in apps crypto ssl; do \
654 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
655 for i in doc/$$subdir/*.pod; do \
656 fn=`basename $$i .pod`; \
657 echo "installing html/$$fn.$(HTMLSUFFIX)"; \
659 | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
660 | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
661 | sed -r 's/<!DOCTYPE.*//g' \
662 > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
663 $(PERL) util/extract-names.pl < $$i | \
664 grep -v $$filecase "^$$fn\$$" | \
665 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
667 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
675 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
678 for subdir in apps crypto ssl; do \
679 for i in doc/$$subdir/*.pod; do \
680 fn=`basename $$i .pod`; \
681 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
682 $(PERL) util/extract-names.pl < $$i | \
683 grep -v $$filecase "^$$fn\$$" | \
685 $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
691 @$(PERL) $(TOP)/util/mkdir-p.pl \
692 $(INSTALL_PREFIX)$(MANDIR)/man1 \
693 $(INSTALL_PREFIX)$(MANDIR)/man3 \
694 $(INSTALL_PREFIX)$(MANDIR)/man5 \
695 $(INSTALL_PREFIX)$(MANDIR)/man7
698 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
701 set -e; for i in doc/apps/*.pod; do \
702 fn=`basename $$i .pod`; \
703 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
704 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
705 (cd `$(PERL) util/dirname.pl $$i`; \
707 --section=$$sec --center=OpenSSL \
708 --release=$(VERSION) `basename $$i`) \
709 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
710 $(PERL) util/extract-names.pl < $$i | \
711 (grep -v $$filecase "^$$fn\$$"; true) | \
712 (grep -v "[ ]"; true) | \
713 (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
715 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
718 set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
719 fn=`basename $$i .pod`; \
720 sec=`$(PERL) util/extract-section.pl 3 < $$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); \
739 case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
742 for i in doc/apps/*.pod; do \
743 fn=`basename $$i .pod`; \
744 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
745 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
746 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
747 $(PERL) util/extract-names.pl < $$i | \
748 (grep -v $$filecase "^$$fn\$$"; true) | \
749 (grep -v "[ ]"; true) | \
751 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
752 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
755 for i in doc/crypto/*.pod doc/ssl/*.pod; do \
756 fn=`basename $$i .pod`; \
757 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
758 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
759 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
760 $(PERL) util/extract-names.pl < $$i | \
761 (grep -v $$filecase "^$$fn\$$"; true) | \
762 (grep -v "[ ]"; true) | \
764 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
765 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
769 # DO NOT DELETE THIS LINE -- make depend depends on it.