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