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