Typo in bn-mips3 rule.
[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 do 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. _REENTERANT 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 PERL= perl
70 TAR= tar
71 TARFLAGS= --no-recursion
72 MAKEDEPPROG=makedepend
73
74 # We let the C compiler driver to take care of .s files. This is done in
75 # order to be excused from maintaining a separate set of architecture
76 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
77 # gcc, then the driver will automatically translate it to -xarch=v8plus
78 # and pass it down to assembler.
79 AS=$(CC) -c
80 ASFLAG=$(CFLAG)
81
82 # For x86 assembler: Set PROCESSOR to 386 if you want to support
83 # the 80386.
84 PROCESSOR=
85
86 # CPUID module collects small commonly used assembler snippets
87 CPUID_OBJ= 
88 BN_ASM= bn_asm.o
89 DES_ENC= des_enc.o fcrypt_b.o
90 AES_ASM_OBJ=aes_core.o aes_cbc.o
91 BF_ENC= bf_enc.o
92 CAST_ENC= c_enc.o
93 RC4_ENC= rc4_enc.o
94 RC5_ENC= rc5_enc.o
95 MD5_ASM_OBJ= 
96 SHA1_ASM_OBJ= 
97 RMD160_ASM_OBJ= 
98
99 # KRB5 stuff
100 KRB5_INCLUDES=
101 LIBKRB5=
102
103 DIRS=   crypto ssl engines apps test tools
104 SHLIBDIRS= crypto ssl
105
106 # dirs in crypto to build
107 SDIRS=  \
108         objects \
109         md2 md4 md5 sha mdc2 hmac ripemd \
110         des aes rc2 rc4 rc5 idea bf cast \
111         bn ec rsa dsa ecdsa dh ecdh dso engine \
112         buffer bio stack lhash rand err \
113         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
114         store pqueue
115 # keep in mind that the above list is adjusted by ./Configure
116 # according to no-xxx arguments...
117
118 # tests to perform.  "alltests" is a special word indicating that all tests
119 # should be performed.
120 TESTS = alltests
121
122 MAKEFILE= Makefile
123
124 MANDIR=$(OPENSSLDIR)/man
125 MAN1=1
126 MAN3=3
127 MANSUFFIX=
128 SHELL=/bin/sh
129
130 TOP=    .
131 ONEDIRS=out tmp
132 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
133 WDIRS=  windows
134 LIBS=   libcrypto.a libssl.a
135 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
136 SHARED_SSL=libssl$(SHLIB_EXT)
137 SHARED_LIBS=
138 SHARED_LIBS_LINK_EXTS=
139 SHARED_LDFLAGS=
140
141 GENERAL=        Makefile
142 BASENAME=       openssl
143 NAME=           $(BASENAME)-$(VERSION)
144 TARFILE=        $(NAME).tar
145 WTARFILE=       $(NAME)-win.tar
146 EXHEADER=       e_os2.h
147 HEADER=         e_os.h
148
149 all: Makefile build_all openssl.pc
150
151 # as we stick to -e, CLEARENV ensures that local variables in lower
152 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
153 # shell, which [annoyingly enough] terminates unset with error if VAR
154 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
155 # which terminates unset with error if no variable was present:-(
156 CLEARENV=       TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
157                 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES}       \
158                 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC}           \
159                 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
160                 $${EXHEADER+EXHEADER} $${HEADER+HEADER}         \
161                 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
162                 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
163                 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
164
165 BUILDENV=       PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
166                 CC='${CC}' CFLAG='${CFLAG}'                     \
167                 AS='${CC}' ASFLAG='${CFLAG} -c'                 \
168                 AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'    \
169                 SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib'   \
170                 INSTALL_PREFIX='${INSTALL_PREFIX}'              \
171                 INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}'   \
172                 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
173                 DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}'    \
174                 MAKEDEPPROG='${MAKEDEPPROG}'                    \
175                 LDFLAGS='${LDFLAGS}' SHARED_LDFLAGS='${SHARED_LDFLAGS}' \
176                 KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'   \
177                 EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'       \
178                 SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
179                 PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}'     \
180                 CPUID_OBJ='${CPUID_OBJ}'                        \
181                 BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}'         \
182                 AES_ASM_OBJ='${AES_ASM_OBJ}'                    \
183                 BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}'       \
184                 RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'       \
185                 SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
186                 MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
187                 RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
188                 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
189 # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
190 # which in turn eliminates ambiguities in variable treatment with -e.
191
192 BUILD_CMD=  if [ -d "$$dir" ]; then \
193             (   cd $$dir && echo "making $$target in $$dir..." && \
194                 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
195             ) || exit 1; \
196             fi
197 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
198
199 reflect:
200         @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
201
202 sub_all: build_all
203 build_all: build_libs build_apps build_tests build_tools
204
205 build_libs: build_crypto build_ssl build_engines
206
207 build_crypto:
208         @dir=crypto; target=all; $(BUILD_CMD)
209 build_ssl:
210         @dir=ssl; target=all; $(BUILD_CMD)
211 build_engines:
212         @dir=engines; target=all; $(BUILD_CMD)
213 build_apps:
214         @dir=apps; target=all; $(BUILD_CMD)
215 build_tests:
216         @dir=test; target=all; $(BUILD_CMD)
217 build_tools:
218         @dir=tools; target=all; $(BUILD_CMD)
219
220 all_testapps: build_libs build_testapps
221 build_testapps:
222         @dir=crypto; target=testapps; $(BUILD_CMD)
223
224 libcrypto$(SHLIB_EXT): libcrypto.a
225         @if [ "$(SHLIB_TARGET)" != "" ]; then \
226                 $(MAKE) SHLIBDIRS=crypto build-shared; \
227         else \
228                 echo "There's no support for shared libraries on this platform" >&2; \
229                 exit 1; \
230         fi
231
232 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
233         @if [ "$(SHLIB_TARGET)" != "" ]; then \
234                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
235         else \
236                 echo "There's no support for shared libraries on this platform" >&2; \
237                 exit 1; \
238         fi
239
240 clean-shared:
241         @set -e; for i in $(SHLIBDIRS); do \
242                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
243                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
244                         for j in $${tmp:-x}; do \
245                                 ( set -x; rm -f lib$$i$$j ); \
246                         done; \
247                 fi; \
248                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
249                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
250                         ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
251                 fi; \
252         done
253
254 link-shared:
255         @ set -e; for i in ${SHLIBDIRS}; do \
256                 $(MAKE) -f $(HERE)/Makefile.shared \
257                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
258                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
259                         symlink.$(SHLIB_TARGET); \
260                 libs="$$libs -l$$i"; \
261         done
262
263 build-shared: do_$(SHLIB_TARGET) link-shared
264
265 do_$(SHLIB_TARGET):
266         @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
267                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
268                         libs="$(LIBKRB5) $$libs"; \
269                 fi; \
270                 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
271                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
272                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
273                         LIBDEPS="$$libs $(EX_LIBS)" \
274                         link_a.$(SHLIB_TARGET); \
275                 libs="-l$$i $$libs"; \
276         done
277
278 openssl.pc: Makefile
279         @ ( echo 'prefix=$(INSTALLTOP)'; \
280             echo 'exec_prefix=$${prefix}'; \
281             echo 'libdir=$${exec_prefix}/lib'; \
282             echo 'includedir=$${prefix}/include'; \
283             echo ''; \
284             echo 'Name: OpenSSL'; \
285             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
286             echo 'Version: '$(VERSION); \
287             echo 'Requires: '; \
288             echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
289             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
290
291 Makefile: Makefile.org Configure config
292         @echo "Makefile is older than Makefile.org, Configure or config."
293         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
294         @false
295
296 libclean:
297         rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
298
299 clean:  libclean
300         rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
301         @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
302         rm -f $(LIBS)
303         rm -f openssl.pc
304         rm -f speed.* .pure
305         rm -f $(TARFILE)
306         @set -e; for i in $(ONEDIRS) ;\
307         do \
308         rm -fr $$i/*; \
309         done
310
311 makefile.one: files
312         $(PERL) util/mk1mf.pl >makefile.one; \
313         sh util/do_ms.sh
314
315 files:
316         $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
317         @set -e; target=files; $(RECURSIVE_BUILD_CMD)
318
319 links:
320         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
321         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
322         @set -e; target=links; $(RECURSIVE_BUILD_CMD)
323
324 gentests:
325         @(cd test && echo "generating dummy tests (if needed)..." && \
326         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
327
328 dclean:
329         rm -f *.bak
330         @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
331
332 rehash: rehash.time
333 rehash.time: certs
334         @(OPENSSL="`pwd`/util/opensslwrap.sh"; \
335           OPENSSL_DEBUG_MEMORY=on; \
336           export OPENSSL OPENSSL_DEBUG_MEMORY; \
337           $(PERL) tools/c_rehash certs)
338         touch rehash.time
339
340 test:   tests
341
342 tests: rehash
343         @(cd test && echo "testing..." && \
344         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
345         util/opensslwrap.sh version -a
346
347 report:
348         @$(PERL) util/selftest.pl
349
350 depend:
351         @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
352
353 lint:
354         @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
355
356 tags:
357         rm -f TAGS
358         find . -name '[^.]*.[ch]' | xargs etags -a
359
360 errors:
361         $(PERL) util/mkerr.pl -recurse -write
362         (cd engines; $(MAKE) PERL=$(PERL) errors)
363         $(PERL) util/ck_errf.pl */*.c */*/*.c
364
365 stacks:
366         $(PERL) util/mkstack.pl -write
367
368 util/libeay.num::
369         $(PERL) util/mkdef.pl crypto update
370
371 util/ssleay.num::
372         $(PERL) util/mkdef.pl ssl update
373
374 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
375         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
376 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
377         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
378
379 apps/openssl-vms.cnf: apps/openssl.cnf
380         $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
381
382 crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
383         $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
384
385
386 TABLE: Configure
387         (echo 'Output of `Configure TABLE'"':"; \
388         $(PERL) Configure TABLE) > TABLE
389
390 update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
391
392 # Build distribution tar-file. As the list of files returned by "find" is
393 # pretty long, on several platforms a "too many arguments" error or similar
394 # would occur. Therefore the list of files is temporarily stored into a file
395 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
396 # tar does not support the --files-from option.
397 tar:
398         find . -type d -print | xargs chmod 755
399         find . -type f -print | xargs chmod a+r
400         find . -type f -perm -0100 -print | xargs chmod a+x
401         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
402         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
403         tardy --user_number=0  --user_name=openssl \
404               --group_number=0 --group_name=openssl \
405               --prefix=openssl-$(VERSION) - |\
406         gzip --best >../$(TARFILE).gz; \
407         rm -f ../$(TARFILE).list; \
408         ls -l ../$(TARFILE).gz
409
410 tar-snap:
411         @$(TAR) $(TARFLAGS) -cvf - \
412                 `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*'  \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
413         tardy --user_number=0  --user_name=openssl \
414               --group_number=0 --group_name=openssl \
415               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
416         ls -l ../$(TARFILE)
417
418 dist:   
419         $(PERL) Configure dist
420         @$(MAKE) dist_pem_h
421         @$(MAKE) SDIRS='${SDIRS}' clean
422         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
423
424 dist_pem_h:
425         (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
426
427 install: all install_docs install_sw
428
429 install_sw:
430         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
431                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
432                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
433                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
434                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
435                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
436                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
437                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
438         @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
439         do \
440         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
441         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
442         done;
443         @set -e; target=install; $(RECURSIVE_BUILD_CMD)
444         @set -e; for i in $(LIBS) ;\
445         do \
446                 if [ -f "$$i" ]; then \
447                 (       echo installing $$i; \
448                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
449                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
450                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
451                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
452                 fi; \
453         done;
454         @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
455                 tmp="$(SHARED_LIBS)"; \
456                 for i in $${tmp:-x}; \
457                 do \
458                         if [ -f "$$i" -o -f "$$i.a" ]; then \
459                         (       echo installing $$i; \
460                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
461                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
462                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
463                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
464                                 else \
465                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
466                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
467                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
468                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
469                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
470                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
471                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
472                                 fi ); \
473                         fi; \
474                 done; \
475                 (       here="`pwd`"; \
476                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
477                         $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
478                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
479                         echo 'OpenSSL shared libraries have been installed in:'; \
480                         echo '  $(INSTALLTOP)'; \
481                         echo ''; \
482                         sed -e '1,/^$$/d' doc/openssl-shared.txt; \
483                 fi; \
484         fi
485         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
486         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
487
488 install_docs:
489         @$(PERL) $(TOP)/util/mkdir-p.pl \
490                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
491                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
492                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
493                 $(INSTALL_PREFIX)$(MANDIR)/man7
494         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
495         here="`pwd`"; \
496         filecase=; \
497         if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
498                 filecase=-i; \
499         fi; \
500         set -e; for i in doc/apps/*.pod; do \
501                 fn=`basename $$i .pod`; \
502                 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
503                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
504                 (cd `$(PERL) util/dirname.pl $$i`; \
505                 sh -c "$$pod2man \
506                         --section=$$sec --center=OpenSSL \
507                         --release=$(VERSION) `basename $$i`") \
508                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
509                 $(PERL) util/extract-names.pl < $$i | \
510                         (grep -v $$filecase "^$$fn\$$"; true) | \
511                         (grep -v "[     ]"; true) | \
512                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
513                          while read n; do \
514                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
515                          done); \
516         done; \
517         set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
518                 fn=`basename $$i .pod`; \
519                 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
520                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
521                 (cd `$(PERL) util/dirname.pl $$i`; \
522                 sh -c "$$pod2man \
523                         --section=$$sec --center=OpenSSL \
524                         --release=$(VERSION) `basename $$i`") \
525                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
526                 $(PERL) util/extract-names.pl < $$i | \
527                         (grep -v $$filecase "^$$fn\$$"; true) | \
528                         (grep -v "[     ]"; true) | \
529                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
530                          while read n; do \
531                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
532                          done); \
533         done
534
535 # DO NOT DELETE THIS LINE -- make depend depends on it.