Fix error when server does not send CertificateStatus message
[openssl.git] / Makefile.org
1 ##
2 ## Makefile for OpenSSL
3 ##
4
5 VERSION=
6 MAJOR=
7 MINOR=
8 SHLIB_VERSION_NUMBER=
9 SHLIB_VERSION_HISTORY=
10 SHLIB_MAJOR=
11 SHLIB_MINOR=
12 SHLIB_EXT=
13 PLATFORM=dist
14 OPTIONS=
15 CONFIGURE_ARGS=
16 SHLIB_TARGET=
17
18 # HERE indicates where this Makefile lives.  This can be used to indicate
19 # where sub-Makefiles are expected to be.  Currently has very limited usage,
20 # and should probably not be bothered with at all.
21 HERE=.
22
23 # INSTALL_PREFIX is for package builders so that they can configure
24 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
25 # Normally it is left empty.
26 INSTALL_PREFIX=
27 INSTALLTOP=/usr/local/ssl
28
29 # Do not edit this manually. Use Configure --openssldir=DIR to change this!
30 OPENSSLDIR=/usr/local/ssl
31
32 # NO_IDEA - Define to build without the IDEA algorithm
33 # NO_RC4  - Define to build without the RC4 algorithm
34 # NO_RC2  - Define to build without the RC2 algorithm
35 # THREADS - Define when building with threads, you will probably also need any
36 #           system defines as well, i.e. _REENTRANT for Solaris 2.[34]
37 # TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
38 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
39 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
40 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
41 #           one.  32 bytes will be read from this when the random
42 #           number generator is initalised.
43 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
44 #           NULL encryption ciphers.
45 #
46 # LOCK_DEBUG - turns on lots of lock debug output :-)
47 # REF_CHECK - turn on some xyz_free() assertions.
48 # REF_PRINT - prints some stuff on structure free.
49 # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
50 # MFUNC - Make all Malloc/Free/Realloc calls call
51 #       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
52 #       call application defined callbacks via CRYPTO_set_mem_functions()
53 # MD5_ASM needs to be defined to use the x86 assembler for MD5
54 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
55 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
56 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
57 # equal 4.
58 # PKCS1_CHECK - pkcs1 tests.
59
60 CC= cc
61 CFLAG= -O
62 DEPFLAG= 
63 PEX_LIBS= 
64 EX_LIBS= 
65 EXE_EXT= 
66 ARFLAGS=
67 AR=ar $(ARFLAGS) r
68 RANLIB= ranlib
69 NM= nm
70 PERL= perl
71 #RM= echo --
72 RM= rm -f
73 TAR= tar
74 TARFLAGS= --no-recursion
75 MAKEDEPPROG=makedepend
76 LIBDIR=lib
77
78 # We let the C compiler driver to take care of .s files. This is done in
79 # order to be excused from maintaining a separate set of architecture
80 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
81 # gcc, then the driver will automatically translate it to -xarch=v8plus
82 # and pass it down to assembler.
83 AS=$(CC) -c
84 ASFLAG=$(CFLAG)
85
86 # For x86 assembler: Set PROCESSOR to 386 if you want to support
87 # the 80386.
88 PROCESSOR=
89
90 # CPUID module collects small commonly used assembler snippets
91 CPUID_OBJ= 
92 BN_ASM= bn_asm.o
93 EC_ASM=
94 DES_ENC= des_enc.o fcrypt_b.o
95 AES_ENC= aes_core.o aes_cbc.o
96 BF_ENC= bf_enc.o
97 CAST_ENC= c_enc.o
98 RC4_ENC= rc4_enc.o
99 RC5_ENC= rc5_enc.o
100 MD5_ASM_OBJ= 
101 SHA1_ASM_OBJ= 
102 RMD160_ASM_OBJ= 
103 WP_ASM_OBJ=
104 CMLL_ENC=
105 MODES_ASM_OBJ=
106 ENGINES_ASM_OBJ=
107 CHACHA_ENC= chacha_enc.o
108 POLY1305_ASM_OBJ=
109 PERLASM_SCHEME=
110
111 # Zlib stuff
112 ZLIB_INCLUDE=
113 LIBZLIB=
114
115 # This is the location of fipscanister.o and friends.
116 # The FIPS module build will place it $(INSTALLTOP)/lib
117 # but since $(INSTALLTOP) can only take the default value
118 # when the module is built it will be in /usr/local/ssl/lib
119 # $(INSTALLTOP) for this build may be different so hard
120 # code the path.
121
122 FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
123
124 # The location of the library which contains fipscanister.o
125 # normally it will be libcrypto. If not compiling in FIPS mode
126 # at all this is empty making it a useful test for a FIPS compile.
127
128 FIPSCANLIB=
129
130 # Shared library base address. Currently only used on Windows.
131 #
132
133 BASEADDR=
134
135 DIRS=   crypto ssl engines apps test tools
136 ENGDIRS= ccgost
137 SHLIBDIRS= crypto ssl
138 INSTALL_SUBS= engines apps tools
139
140 # dirs in crypto to build
141 SDIRS=  \
142         objects \
143         md2 md4 md5 sha mdc2 hmac ripemd whrlpool poly1305 \
144         des aes rc2 rc4 rc5 idea bf cast camellia seed chacha modes \
145         bn ec rsa dsa dh dso engine \
146         buffer bio stack lhash rand err \
147         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui \
148         cms pqueue ts jpake srp store cmac ct async
149 # keep in mind that the above list is adjusted by ./Configure
150 # according to no-xxx arguments...
151
152 # tests to perform.  "alltests" is a special word indicating that all tests
153 # should be performed.
154 TESTS = alltests
155
156 MAKEFILE= Makefile
157
158 MANDIR=$(OPENSSLDIR)/man
159 MAN1=1
160 MAN3=3
161 MANSUFFIX=
162 HTMLSUFFIX=html
163 HTMLDIR=$(OPENSSLDIR)/html
164 SHELL=/bin/sh
165
166 TOP=    .
167 LIBS=   libcrypto.a libssl.a
168 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
169 SHARED_SSL=libssl$(SHLIB_EXT)
170 SHARED_LIBS=
171 SHARED_LIBS_LINK_EXTS=
172 SHARED_LDFLAGS=
173
174 GENERAL=        Makefile
175 BASENAME=       openssl
176 NAME=           $(BASENAME)-$(VERSION)
177 TARFILE=        ../$(NAME).tar
178 HEADER=         e_os.h
179
180 # Directories created on install if they don't exist.
181 INSTALLDIRS=    \
182                 $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
183                 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
184                 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
185                 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \
186                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
187                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
188                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
189                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
190
191 all: Makefile build_all
192
193 # as we stick to -e, CLEARENV ensures that local variables in lower
194 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
195 # shell, which [annoyingly enough] terminates unset with error if VAR
196 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
197 # which terminates unset with error if no variable was present:-(
198 CLEARENV=       TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
199                 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES}       \
200                 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC}           \
201                 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
202                 $${HEADER+HEADER}                               \
203                 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
204                 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
205                 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \
206                 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}     \
207                 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
208
209 # LC_ALL=C ensures that error [and other] messages are delivered in
210 # same language for uniform treatment.
211 BUILDENV=       LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
212                 CC='$(CC)' CFLAG='$(CFLAG)'                     \
213                 AS='$(CC)' ASFLAG='$(CFLAG) -c'                 \
214                 AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'        \
215                 CROSS_COMPILE='$(CROSS_COMPILE)'        \
216                 PERL='$(PERL)' ENGDIRS='$(ENGDIRS)'             \
217                 SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)'     \
218                 INSTALL_PREFIX='$(INSTALL_PREFIX)'              \
219                 INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)'   \
220                 LIBDIR='$(LIBDIR)'                              \
221                 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
222                 DEPFLAG='$(DEPFLAG)'                            \
223                 MAKEDEPPROG='$(MAKEDEPPROG)'                    \
224                 SHARED_LDFLAGS='$(SHARED_LDFLAGS)'              \
225                 ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)'     \
226                 EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)'       \
227                 SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
228                 PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)'     \
229                 CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)'     \
230                 EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)'         \
231                 AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)'     \
232                 BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)'       \
233                 RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)'       \
234                 SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)'                  \
235                 MD5_ASM_OBJ='$(MD5_ASM_OBJ)'                    \
236                 RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)'              \
237                 WP_ASM_OBJ='$(WP_ASM_OBJ)'                      \
238                 MODES_ASM_OBJ='$(MODES_ASM_OBJ)'                \
239                 ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)'            \
240                 CHACHA_ENC='$(CHACHA_ENC)'                      \
241                 POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)'          \
242                 PERLASM_SCHEME='$(PERLASM_SCHEME)'              \
243                 FIPSLIBDIR='${FIPSLIBDIR}'                      \
244                 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}"      \
245                 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
246 # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
247 # which in turn eliminates ambiguities in variable treatment with -e.
248
249 # BUILD_CMD is a generic macro to build a given target in a given
250 # subdirectory.  The target must be given through the shell variable
251 # `target' and the subdirectory to build in must be given through `dir'.
252 # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
253 # BUILD_ONE_CMD instead.
254 #
255 # RECURSIVE_BUILD_CMD is a macro to build a given target in all
256 # subdirectories defined in $(DIRS).  It requires that the target
257 # is given through the shell variable `target'.
258 #
259 # BUILD_ONE_CMD is a macro to build a given target in a given
260 # subdirectory if that subdirectory is part of $(DIRS).  It requires
261 # exactly the same shell variables as BUILD_CMD.
262 BUILD_CMD=  if [ -d "$$dir" ]; then \
263             (   cd $$dir && echo "making $$target in $$dir..." && \
264                 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
265             ) || exit 1; \
266             fi
267 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
268 BUILD_ONE_CMD=\
269         if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
270                 $(BUILD_CMD); \
271         fi
272
273 reflect:
274         @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
275
276 sub_all: build_all
277
278 build_all: build_libs build_apps build_tests build_tools
279
280 build_libs: build_libcrypto build_libssl openssl.pc
281
282 build_libcrypto: build_crypto build_engines libcrypto.pc
283 build_libssl: build_ssl libssl.pc
284
285 build_crypto:
286         @dir=crypto; target=all; $(BUILD_ONE_CMD)
287 build_ssl: build_crypto
288         @dir=ssl; target=all; $(BUILD_ONE_CMD)
289 build_engines: build_crypto
290         @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD)
291
292 build_apps: build_libs
293         @dir=apps; target=all; $(BUILD_ONE_CMD)
294 build_tests: build_libs
295         @dir=test; target=all; $(BUILD_ONE_CMD)
296 build_tools: build_libs
297         @dir=tools; target=all; $(BUILD_ONE_CMD)
298
299 all_testapps: build_libs build_testapps
300 build_testapps:
301         @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
302
303 libcrypto$(SHLIB_EXT): libcrypto.a
304         @if [ "$(SHLIB_TARGET)" != "" ]; then \
305                 if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
306                         FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
307                         export CC FIPSLD_CC; \
308                 fi; \
309                 $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \
310         else \
311                 echo "There's no support for shared libraries on this platform" >&2; \
312                 exit 1; \
313         fi
314
315 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
316         @if [ "$(SHLIB_TARGET)" != "" ]; then \
317                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
318         else \
319                 echo "There's no support for shared libraries on this platform" >&2; \
320                 exit 1; \
321         fi
322
323 clean-shared:
324         @set -e; for i in $(SHLIBDIRS); do \
325                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
326                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
327                         for j in $${tmp:-x}; do \
328                                 ( set -x; rm -f lib$$i$$j ); \
329                         done; \
330                 fi; \
331                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
332                 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
333                         ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
334                 fi; \
335         done
336
337 link-shared:
338         @ set -e; for i in $(SHLIBDIRS); do \
339                 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
340                         LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
341                         LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
342                         symlink.$(SHLIB_TARGET); \
343                 libs="$$libs -l$$i"; \
344         done
345
346 build-shared: do_$(SHLIB_TARGET) link-shared
347
348 do_$(SHLIB_TARGET):
349         @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
350                 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
351                         LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
352                         LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
353                         LIBDEPS="$$libs $(EX_LIBS)" \
354                         link_a.$(SHLIB_TARGET); \
355                 libs="-l$$i $$libs"; \
356         done
357
358 libcrypto.pc: Makefile
359         @ ( echo 'prefix=$(INSTALLTOP)'; \
360             echo 'exec_prefix=$${prefix}'; \
361             echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
362             echo 'includedir=$${prefix}/include'; \
363             echo ''; \
364             echo 'Name: OpenSSL-libcrypto'; \
365             echo 'Description: OpenSSL cryptography library'; \
366             echo 'Version: '$(VERSION); \
367             echo 'Requires: '; \
368             echo 'Libs: -L$${libdir} -lcrypto'; \
369             echo 'Libs.private: $(EX_LIBS)'; \
370             echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
371
372 libssl.pc: Makefile
373         @ ( echo 'prefix=$(INSTALLTOP)'; \
374             echo 'exec_prefix=$${prefix}'; \
375             echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
376             echo 'includedir=$${prefix}/include'; \
377             echo ''; \
378             echo 'Name: OpenSSL-libssl'; \
379             echo 'Description: Secure Sockets Layer and cryptography libraries'; \
380             echo 'Version: '$(VERSION); \
381             echo 'Requires.private: libcrypto'; \
382             echo 'Libs: -L$${libdir} -lssl'; \
383             echo 'Libs.private: $(EX_LIBS)'; \
384             echo 'Cflags: -I$${includedir}' ) > libssl.pc
385
386 openssl.pc: Makefile
387         @ ( echo 'prefix=$(INSTALLTOP)'; \
388             echo 'exec_prefix=$${prefix}'; \
389             echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
390             echo 'includedir=$${prefix}/include'; \
391             echo ''; \
392             echo 'Name: OpenSSL'; \
393             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
394             echo 'Version: '$(VERSION); \
395             echo 'Requires: libssl libcrypto' ) > openssl.pc
396
397 Makefile: Makefile.org Configure config
398         @echo "Makefile is older than Makefile.org, Configure or config."
399         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
400         @false
401
402 libclean:
403         rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib
404
405 clean:  libclean
406         rm -f */*/*.o */*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
407         rm -rf *.bak certs/.0
408         @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
409         rm -f $(LIBS) tags TAGS
410         rm -f openssl.pc libssl.pc libcrypto.pc
411         rm -f speed.* .pure
412         rm -f $(TARFILE)
413
414 makefile.one: files
415         $(PERL) util/mk1mf.pl >makefile.one; \
416         sh util/do_ms.sh
417
418 files:
419         $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
420         @set -e; target=files; $(RECURSIVE_BUILD_CMD)
421
422 gentests:
423         @(cd test && echo "generating dummy tests (if needed)..." && \
424         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
425
426 dclean:
427         @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
428
429 rehash: rehash.time
430 rehash.time: certs apps
431         @if [ -z "$(CROSS_COMPILE)" ]; then \
432                 (OPENSSL="`pwd`/util/opensslwrap.sh"; \
433                 [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \
434                 OPENSSL_DEBUG_MEMORY=on; OPENSSL_CONF=/dev/null ; \
435                 export OPENSSL OPENSSL_DEBUG_MEMORY OPENSSL_CONF; \
436                 $$OPENSSL rehash certs/demo) && \
437                 touch rehash.time; \
438         else :; fi
439
440 test:   tests
441
442 test_ordinals:
443         TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals
444
445 tests: rehash
446         @(cd test && echo "testing..." && \
447         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
448         @if [ -z "$(CROSS_COMPILE)" ]; then \
449                 OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \
450         fi
451
452 list-tests:
453         @(cd test && \
454                 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)
455
456 report:
457         @$(PERL) util/selftest.pl
458
459 update: errors stacks util/libeay.num util/ssleay.num TABLE test_ordinals
460         @set -e; target=update; $(RECURSIVE_BUILD_CMD)
461
462 depend:
463         @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
464
465 lint:
466         @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
467
468 tags TAGS: FORCE
469         rm -f TAGS tags
470         -ctags -R .
471         -etags `find . -name '*.[ch]' -o -name '*.pm'`
472
473 FORCE:
474
475 errors:
476         $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
477         $(PERL) util/mkerr.pl -recurse -write
478         (cd engines; $(MAKE) PERL=$(PERL) errors)
479         (cd crypto/ct; $(MAKE) PERL=$(PERL) errors)
480
481 stacks:
482         $(PERL) util/mkstack.pl -write
483
484 util/libeay.num::
485         $(PERL) util/mkdef.pl crypto update
486
487 util/ssleay.num::
488         $(PERL) util/mkdef.pl ssl update
489
490 TABLE: Configure Configurations/*.conf
491         (echo 'Output of `Configure TABLE'"':"; \
492         $(PERL) Configure TABLE) > TABLE
493
494 # Build distribution tar-file. As the list of files returned by "find" is
495 # pretty long, on several platforms a "too many arguments" error or similar
496 # would occur. Therefore the list of files is temporarily stored into a file
497 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
498 # tar does not support the --files-from option.
499 TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \
500                                --owner 0 --group 0 \
501                                --transform 's|^|$(NAME)/|' \
502                                -cvf -
503
504 $(TARFILE).list:
505         find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
506                \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \
507                \! -name '*test' \! -name '.#*' \! -name '*~' \! -type l \
508             | sort > $(TARFILE).list
509
510 tar: $(TARFILE).list
511         find . -type d -print | xargs chmod 755
512         find . -type f -print | xargs chmod a+r
513         find . -type f -perm -0100 -print | xargs chmod a+x
514         $(TAR_COMMAND) | gzip --best > $(TARFILE).gz
515         rm -f $(TARFILE).list
516         ls -l $(TARFILE).gz
517
518 tar-snap: $(TARFILE).list
519         $(TAR_COMMAND) > $(TARFILE)
520         rm -f $(TARFILE).list
521         ls -l $(TARFILE)
522
523 dist:   
524         $(PERL) Configure dist
525         @$(MAKE) SDIRS='$(SDIRS)' clean
526         @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar
527
528 install: all install_docs install_sw
529
530 uninstall: uninstall_sw uninstall_docs
531
532 install_sw:
533         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS)
534         @set -e; for i in include/openssl/*.h; do \
535         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$$i; \
536         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$$i ); \
537         done;
538         @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done
539         @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
540         do \
541                 if [ -f "$$i" ]; then \
542                 (       echo installing $$i; \
543                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
544                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
545                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
546                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \
547                 fi; \
548         done;
549         @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
550                 tmp="$(SHARED_LIBS)"; \
551                 for i in $${tmp:-x}; \
552                 do \
553                         if [ -f "$$i" -o -f "$$i.a" ]; then \
554                         (       echo installing $$i; \
555                                 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
556                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
557                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
558                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
559                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
560                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
561                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
562                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
563                                 else \
564                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
565                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \
566                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
567                                 fi ); \
568                                 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
569                                 (       case $$i in \
570                                                 *crypto*) i=libeay32.dll;; \
571                                                 *ssl*)    i=ssleay32.dll;; \
572                                         esac; \
573                                         echo installing $$i; \
574                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
575                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
576                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
577                                 fi; \
578                         fi; \
579                 done; \
580                 (       here="`pwd`"; \
581                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \
582                         $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
583                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
584                         echo 'OpenSSL shared libraries have been installed in:'; \
585                         echo '  $(INSTALLTOP)'; \
586                 fi; \
587         fi
588         cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
589         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
590         cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
591         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
592         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
593         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
594
595 uninstall_sw:
596         cd include/openssl && files=* && cd $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl && $(RM) $$files
597         @for i in $(LIBS) ;\
598         do \
599                 test -f "$$i" && \
600                 echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i && \
601                 $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
602         done;
603         @if [ -n "$(SHARED_LIBS)" ]; then \
604                 tmp="$(SHARED_LIBS)"; \
605                 for i in $${tmp:-x}; \
606                 do \
607                         if [ -f "$$i" -o -f "$$i.a" ]; then \
608                                 if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
609                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
610                                         echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
611                                         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
612                                         echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
613                                         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
614                                 else \
615                                         echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
616                                         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \
617                                 fi; \
618                                 if expr $(PLATFORM) : 'mingw' > /dev/null; then \
619                                         case $$i in \
620                                                 *crypto*) i=libeay32.dll;; \
621                                                 *ssl*)    i=ssleay32.dll;; \
622                                         esac; \
623                                         echo $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
624                                         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \
625                                 fi; \
626                         fi; \
627                 done; \
628         fi
629         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
630         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
631         $(RM) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
632         @target=uninstall; $(RECURSIVE_BUILD_CMD)
633
634 install_html_docs:
635         here="`pwd`"; \
636         filecase=; \
637         case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
638                 filecase=-i; \
639         esac; \
640         for subdir in apps crypto ssl; do \
641                 $(PERL) $(TOP)/util/mkdir-p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
642                 for i in doc/$$subdir/*.pod; do \
643                         fn=`basename $$i .pod`; \
644                         echo "installing html/$$fn.$(HTMLSUFFIX)"; \
645                         cat $$i \
646                         | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \
647                         | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \
648                         | sed -r 's/<!DOCTYPE.*//g' \
649                         > $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
650                         $(PERL) util/extract-names.pl < $$i | \
651                                 grep -v $$filecase "^$$fn\$$" | \
652                                 (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
653                                  while read n; do \
654                                         PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
655                                  done); \
656                 done; \
657         done
658
659 uninstall_html_docs:
660         here="`pwd`"; \
661         filecase=; \
662         case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
663                 filecase=-i; \
664         esac; \
665         for subdir in apps crypto ssl; do \
666                 for i in doc/$$subdir/*.pod; do \
667                         fn=`basename $$i .pod`; \
668                         $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \
669                         $(PERL) util/extract-names.pl < $$i | \
670                                 grep -v $$filecase "^$$fn\$$" | \
671                                 while read n; do \
672                                         $(RM) $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \
673                                 done; \
674                 done; \
675         done
676
677 install_docs:
678         @$(PERL) $(TOP)/util/mkdir-p.pl \
679                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
680                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
681                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
682                 $(INSTALL_PREFIX)$(MANDIR)/man7
683         here="`pwd`"; \
684         filecase=; \
685         case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \
686                 filecase=-i; \
687         esac; \
688         set -e; for i in doc/apps/*.pod; do \
689                 fn=`basename $$i .pod`; \
690                 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
691                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
692                 (cd `$(PERL) util/dirname.pl $$i`; \
693                 pod2man \
694                         --section=$$sec --center=OpenSSL \
695                         --release=$(VERSION) `basename $$i`) \
696                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
697                 $(PERL) util/extract-names.pl < $$i | \
698                         (grep -v $$filecase "^$$fn\$$"; true) | \
699                         (grep -v "[     ]"; true) | \
700                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
701                          while read n; do \
702                                 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
703                          done); \
704         done; \
705         set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
706                 fn=`basename $$i .pod`; \
707                 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
708                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
709                 (cd `$(PERL) util/dirname.pl $$i`; \
710                 pod2man \
711                         --section=$$sec --center=OpenSSL \
712                         --release=$(VERSION) `basename $$i`) \
713                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
714                 $(PERL) util/extract-names.pl < $$i | \
715                         (grep -v $$filecase "^$$fn\$$"; true) | \
716                         (grep -v "[     ]"; true) | \
717                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
718                          while read n; do \
719                                 PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
720                          done); \
721         done
722
723 uninstall_docs:
724         @here="`pwd`"; \
725         filecase=; \
726         case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \
727                 filecase=-i; \
728         esac; \
729         for i in doc/apps/*.pod; do \
730                 fn=`basename $$i .pod`; \
731                 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
732                 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
733                 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
734                 $(PERL) util/extract-names.pl < $$i | \
735                         (grep -v $$filecase "^$$fn\$$"; true) | \
736                         (grep -v "[     ]"; true) | \
737                         while read n; do \
738                                 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
739                                 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
740                         done; \
741         done; \
742         for i in doc/crypto/*.pod doc/ssl/*.pod; do \
743                 fn=`basename $$i .pod`; \
744                 sec=`$(PERL) util/extract-section.pl 3 < $$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) | \
750                         while read n; do \
751                                 echo $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
752                                 $(RM) $(INSTALL_PREFIX)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \
753                         done; \
754         done
755
756 # DO NOT DELETE THIS LINE -- make depend depends on it.