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