b78a82ec9309849dc0c90ba6dc95f7d2837b4981
[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 set:-(
155 CLEARENV=       unset $${TOP+TOP} $${LIB+LIB} $${LIBS+LIBS}     \
156                 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES}       \
157                 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC}           \
158                 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
159                 $${EXHEADER+EXHEADER} $${HEADER+HEADER}         \
160                 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
161                 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
162                 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
163
164 BUILDENV=       PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
165                 CC='${CC}' CFLAG='${CFLAG}'                     \
166                 AS='${CC}' ASFLAG='${CFLAG} -c'                 \
167                 AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'    \
168                 SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib'   \
169                 INSTALL_PREFIX='${INSTALL_PREFIX}'              \
170                 INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}'   \
171                 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
172                 DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}'    \
173                 MAKEDEPPROG='${MAKEDEPPROG}'                    \
174                 LDFLAGS='${LDFLAGS}' SHARED_LDFLAGS='${SHARED_LDFLAGS}' \
175                 KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'   \
176                 EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'       \
177                 SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
178                 PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}'     \
179                 CPUID_OBJ='${CPUID_OBJ}'                        \
180                 BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}'         \
181                 AES_ASM_OBJ='${AES_ASM_OBJ}'                    \
182                 BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}'       \
183                 RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'       \
184                 SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
185                 MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
186                 RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
187                 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
188 # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
189 # which in turn eliminates ambiguities in variable treatment with -e.
190
191 BUILD_CMD=  if [ -d "$$dir" ]; then \
192             (   cd $$dir && echo "making $$target in $$dir..." && \
193                 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
194             ) || exit 1; \
195             fi
196 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
197
198 reflect:
199         @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
200
201 sub_all: build_all
202 build_all: build_libs build_apps build_tests build_tools
203
204 build_libs: build_crypto build_ssl build_engines
205
206 build_crypto:
207         @dir=crypto; target=all; $(BUILD_CMD)
208 build_ssl:
209         @dir=ssl; target=all; $(BUILD_CMD)
210 build_engines:
211         @dir=engines; target=all; $(BUILD_CMD)
212 build_apps:
213         @dir=apps; target=all; $(BUILD_CMD)
214 build_tests:
215         @dir=test; target=all; $(BUILD_CMD)
216 build_tools:
217         @dir=tools; target=all; $(BUILD_CMD)
218
219 all_testapps: build_libs build_testapps
220 build_testapps:
221         @dir=crypto; target=testapps; $(BUILD_CMD)
222
223 libcrypto$(SHLIB_EXT): libcrypto.a
224         @if [ "$(SHLIB_TARGET)" != "" ]; then \
225                 $(MAKE) SHLIBDIRS=crypto build-shared; \
226         else \
227                 echo "There's no support for shared libraries on this platform" >&2; \
228                 exit 1; \
229         fi
230
231 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
232         @if [ "$(SHLIB_TARGET)" != "" ]; then \
233                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
234         else \
235                 echo "There's no support for shared libraries on this platform" >&2; \
236                 exit 1; \
237         fi
238
239 clean-shared:
240         @set -e; for i in $(SHLIBDIRS); do \
241                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
242                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
243                         for j in $${tmp:-x}; do \
244                                 ( set -x; rm -f lib$$i$$j ); \
245                         done; \
246                 fi; \
247                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
248                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
249                         ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
250                 fi; \
251         done
252
253 link-shared:
254         @ set -e; for i in ${SHLIBDIRS}; do \
255                 $(MAKE) -f $(HERE)/Makefile.shared \
256                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
257                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
258                         symlink.$(SHLIB_TARGET); \
259                 libs="$$libs -l$$i"; \
260         done
261
262 build-shared: do_$(SHLIB_TARGET) link-shared
263
264 do_$(SHLIB_TARGET):
265         @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
266                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
267                         libs="$(LIBKRB5) $$libs"; \
268                 fi; \
269                 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
270                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
271                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
272                         LIBDEPS="$$libs $(EX_LIBS)" \
273                         link_a.$(SHLIB_TARGET); \
274                 libs="-l$$i $$libs"; \
275         done
276
277 openssl.pc: Makefile
278         @ ( echo 'prefix=$(INSTALLTOP)'; \
279             echo 'exec_prefix=$${prefix}'; \
280             echo 'libdir=$${exec_prefix}/lib'; \
281             echo 'includedir=$${prefix}/include'; \
282             echo ''; \
283             echo 'Name: OpenSSL'; \
284             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
285             echo 'Version: '$(VERSION); \
286             echo 'Requires: '; \
287             echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
288             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
289
290 Makefile: Makefile.org Configure config
291         @echo "Makefile is older than Makefile.org, Configure or config."
292         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
293         @false
294
295 libclean:
296         rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
297
298 clean:  libclean
299         rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
300         @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
301         rm -f $(LIBS)
302         rm -f openssl.pc
303         rm -f speed.* .pure
304         rm -f $(TARFILE)
305         @set -e; for i in $(ONEDIRS) ;\
306         do \
307         rm -fr $$i/*; \
308         done
309
310 makefile.one: files
311         $(PERL) util/mk1mf.pl >makefile.one; \
312         sh util/do_ms.sh
313
314 files:
315         $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
316         @set -e; target=files; $(RECURSIVE_BUILD_CMD)
317
318 links:
319         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
320         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
321         @set -e; target=links; $(RECURSIVE_BUILD_CMD)
322
323 gentests:
324         @(cd test && echo "generating dummy tests (if needed)..." && \
325         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
326
327 dclean:
328         rm -f *.bak
329         @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
330
331 rehash: rehash.time
332 rehash.time: certs
333         @(OPENSSL="`pwd`/util/opensslwrap.sh"; \
334           OPENSSL_DEBUG_MEMORY=on; \
335           export OPENSSL OPENSSL_DEBUG_MEMORY; \
336           $(PERL) tools/c_rehash certs)
337         touch rehash.time
338
339 test:   tests
340
341 tests: rehash
342         @(cd test && echo "testing..." && \
343         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
344         util/opensslwrap.sh version -a
345
346 report:
347         @$(PERL) util/selftest.pl
348
349 depend:
350         @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
351
352 lint:
353         @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
354
355 tags:
356         rm -f TAGS
357         find . -name '[^.]*.[ch]' | xargs etags -a
358
359 errors:
360         $(PERL) util/mkerr.pl -recurse -write
361         (cd engines; $(MAKE) PERL=$(PERL) errors)
362         $(PERL) util/ck_errf.pl */*.c */*/*.c
363
364 stacks:
365         $(PERL) util/mkstack.pl -write
366
367 util/libeay.num::
368         $(PERL) util/mkdef.pl crypto update
369
370 util/ssleay.num::
371         $(PERL) util/mkdef.pl ssl update
372
373 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
374         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
375 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
376         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
377
378 apps/openssl-vms.cnf: apps/openssl.cnf
379         $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
380
381 crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
382         $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
383
384
385 TABLE: Configure
386         (echo 'Output of `Configure TABLE'"':"; \
387         $(PERL) Configure TABLE) > TABLE
388
389 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
390
391 # Build distribution tar-file. As the list of files returned by "find" is
392 # pretty long, on several platforms a "too many arguments" error or similar
393 # would occur. Therefore the list of files is temporarily stored into a file
394 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
395 # tar does not support the --files-from option.
396 tar:
397         find . -type d -print | xargs chmod 755
398         find . -type f -print | xargs chmod a+r
399         find . -type f -perm -0100 -print | xargs chmod a+x
400         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
401         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
402         tardy --user_number=0  --user_name=openssl \
403               --group_number=0 --group_name=openssl \
404               --prefix=openssl-$(VERSION) - |\
405         gzip --best >../$(TARFILE).gz; \
406         rm -f ../$(TARFILE).list; \
407         ls -l ../$(TARFILE).gz
408
409 tar-snap:
410         @$(TAR) $(TARFLAGS) -cvf - \
411                 `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` |\
412         tardy --user_number=0  --user_name=openssl \
413               --group_number=0 --group_name=openssl \
414               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
415         ls -l ../$(TARFILE)
416
417 dist:   
418         $(PERL) Configure dist
419         @$(MAKE) dist_pem_h
420         @$(MAKE) SDIRS='${SDIRS}' clean
421         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
422
423 dist_pem_h:
424         (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
425
426 install: all install_docs install_sw
427
428 install_sw:
429         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
430                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
431                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
432                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
433                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
434                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
435                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
436                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
437         @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
438         do \
439         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
440         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
441         done;
442         @set -e; target=install; $(RECURSIVE_BUILD_CMD)
443         @set -e; for i in $(LIBS) ;\
444         do \
445                 if [ -f "$$i" ]; then \
446                 (       echo installing $$i; \
447                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
448                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
449                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
450                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
451                 fi; \
452         done;
453         @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
454                 tmp="$(SHARED_LIBS)"; \
455                 for i in $${tmp:-x}; \
456                 do \
457                         if [ -f "$$i" -o -f "$$i.a" ]; then \
458                         (       echo installing $$i; \
459                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
460                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
461                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
462                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
463                                 else \
464                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
465                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
466                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
467                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
468                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
469                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
470                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
471                                 fi ); \
472                         fi; \
473                 done; \
474                 (       here="`pwd`"; \
475                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
476                         $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
477                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
478                         echo 'OpenSSL shared libraries have been installed in:'; \
479                         echo '  $(INSTALLTOP)'; \
480                         echo ''; \
481                         sed -e '1,/^$$/d' doc/openssl-shared.txt; \
482                 fi; \
483         fi
484         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
485         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
486
487 install_docs:
488         @$(PERL) $(TOP)/util/mkdir-p.pl \
489                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
490                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
491                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
492                 $(INSTALL_PREFIX)$(MANDIR)/man7
493         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
494         here="`pwd`"; \
495         filecase=; \
496         if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
497                 filecase=-i; \
498         fi; \
499         set -e; for i in doc/apps/*.pod; do \
500                 fn=`basename $$i .pod`; \
501                 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
502                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
503                 (cd `$(PERL) util/dirname.pl $$i`; \
504                 sh -c "$$pod2man \
505                         --section=$$sec --center=OpenSSL \
506                         --release=$(VERSION) `basename $$i`") \
507                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
508                 $(PERL) util/extract-names.pl < $$i | \
509                         (grep -v $$filecase "^$$fn\$$"; true) | \
510                         (grep -v "[     ]"; true) | \
511                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
512                          while read n; do \
513                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
514                          done); \
515         done; \
516         set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
517                 fn=`basename $$i .pod`; \
518                 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
519                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
520                 (cd `$(PERL) util/dirname.pl $$i`; \
521                 sh -c "$$pod2man \
522                         --section=$$sec --center=OpenSSL \
523                         --release=$(VERSION) `basename $$i`") \
524                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
525                 $(PERL) util/extract-names.pl < $$i | \
526                         (grep -v $$filecase "^$$fn\$$"; true) | \
527                         (grep -v "[     ]"; true) | \
528                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
529                          while read n; do \
530                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
531                          done); \
532         done
533
534 # DO NOT DELETE THIS LINE -- make depend depends on it.