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