Merge from vendor branch LIBARCHIVE:
[dragonfly.git] / crypto / openssl-0.9.7d / 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= gcc
61 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
62 CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
63 DEPFLAG= 
64 PEX_LIBS= 
65 EX_LIBS= 
66 EXE_EXT= 
67 ARFLAGS=
68 AR=ar $(ARFLAGS) r
69 RANLIB= ranlib
70 PERL= perl
71 TAR= tar
72 TARFLAGS= --no-recursion
73 MAKEDEPPROG=makedepend
74
75 # We let the C compiler driver to take care of .s files. This is done in
76 # order to be excused from maintaining a separate set of architecture
77 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
78 # gcc, then the driver will automatically translate it to -xarch=v8plus
79 # and pass it down to assembler.
80 AS=$(CC) -c
81 ASFLAG=$(CFLAG)
82
83 # Set BN_ASM to bn_asm.o if you want to use the C version
84 BN_ASM= bn_asm.o
85 #BN_ASM= bn_asm.o
86 #BN_ASM= asm/bn86-elf.o # elf, linux-elf
87 #BN_ASM= asm/bn86-sol.o # solaris
88 #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
89 #BN_ASM= asm/bn86bsdi.o # bsdi
90 #BN_ASM= asm/alpha.o    # DEC Alpha
91 #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
92 #BN_ASM= asm/r3000.o    # SGI MIPS cpu
93 #BN_ASM= asm/sparc.o    # Sun solaris/SunOS
94 #BN_ASM= asm/bn-win32.o # Windows 95/NT
95 #BN_ASM= asm/x86w16.o   # 16 bit code for Windows 3.1/DOS
96 #BN_ASM= asm/x86w32.o   # 32 bit code for Windows 3.1
97
98 # For x86 assembler: Set PROCESSOR to 386 if you want to support
99 # the 80386.
100 PROCESSOR=
101
102 # Set DES_ENC to des_enc.o if you want to use the C version
103 #There are 4 x86 assember options.
104 DES_ENC= asm/dx86-out.o asm/yx86-out.o
105 #DES_ENC= des_enc.o fcrypt_b.o          # C
106 #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
107 #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
108 #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
109 #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
110
111 # Set BF_ENC to bf_enc.o if you want to use the C version
112 #There are 4 x86 assember options.
113 BF_ENC= asm/bx86-out.o
114 #BF_ENC= bf_enc.o
115 #BF_ENC= asm/bx86-elf.o # elf
116 #BF_ENC= asm/bx86-sol.o # solaris
117 #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
118 #BF_ENC= asm/bx86bsdi.o # bsdi
119
120 # Set CAST_ENC to c_enc.o if you want to use the C version
121 #There are 4 x86 assember options.
122 CAST_ENC= asm/cx86-out.o
123 #CAST_ENC= c_enc.o
124 #CAST_ENC= asm/cx86-elf.o # elf
125 #CAST_ENC= asm/cx86-sol.o # solaris
126 #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
127 #CAST_ENC= asm/cx86bsdi.o # bsdi
128
129 # Set RC4_ENC to rc4_enc.o if you want to use the C version
130 #There are 4 x86 assember options.
131 RC4_ENC= asm/rx86-out.o
132 #RC4_ENC= rc4_enc.o
133 #RC4_ENC= asm/rx86-elf.o # elf
134 #RC4_ENC= asm/rx86-sol.o # solaris
135 #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
136 #RC4_ENC= asm/rx86bsdi.o # bsdi
137
138 # Set RC5_ENC to rc5_enc.o if you want to use the C version
139 #There are 4 x86 assember options.
140 RC5_ENC= asm/r586-out.o
141 #RC5_ENC= rc5_enc.o
142 #RC5_ENC= asm/r586-elf.o # elf
143 #RC5_ENC= asm/r586-sol.o # solaris
144 #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
145 #RC5_ENC= asm/r586bsdi.o # bsdi
146
147 # Also need MD5_ASM defined
148 MD5_ASM_OBJ= asm/mx86-out.o
149 #MD5_ASM_OBJ= asm/mx86-elf.o        # elf
150 #MD5_ASM_OBJ= asm/mx86-sol.o        # solaris
151 #MD5_ASM_OBJ= asm/mx86-out.o        # a.out, FreeBSD
152 #MD5_ASM_OBJ= asm/mx86bsdi.o        # bsdi
153
154 # Also need SHA1_ASM defined
155 SHA1_ASM_OBJ= asm/sx86-out.o
156 #SHA1_ASM_OBJ= asm/sx86-elf.o       # elf
157 #SHA1_ASM_OBJ= asm/sx86-sol.o       # solaris
158 #SHA1_ASM_OBJ= asm/sx86-out.o       # a.out, FreeBSD
159 #SHA1_ASM_OBJ= asm/sx86bsdi.o       # bsdi
160
161 # Also need RMD160_ASM defined
162 RMD160_ASM_OBJ= asm/rm86-out.o
163 #RMD160_ASM_OBJ= asm/rm86-elf.o       # elf
164 #RMD160_ASM_OBJ= asm/rm86-sol.o       # solaris
165 #RMD160_ASM_OBJ= asm/rm86-out.o       # a.out, FreeBSD
166 #RMD160_ASM_OBJ= asm/rm86bsdi.o       # bsdi
167
168 # KRB5 stuff
169 KRB5_INCLUDES=
170 LIBKRB5=
171
172 # When we're prepared to use shared libraries in the programs we link here
173 # we might set SHLIB_MARK to '$(SHARED_LIBS)'.
174 SHLIB_MARK=
175
176 DIRS=   crypto ssl $(SHLIB_MARK) apps test tools
177 SHLIBDIRS= crypto ssl
178
179 # dirs in crypto to build
180 SDIRS=  \
181         md2 md4 md5 sha mdc2 hmac ripemd \
182         des rc2 rc4 rc5 idea bf cast \
183         bn ec rsa dsa dh dso engine aes \
184         buffer bio stack lhash rand err objects \
185         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
186
187 # tests to perform.  "alltests" is a special word indicating that all tests
188 # should be performed.
189 TESTS = alltests
190
191 MAKEFILE= Makefile.ssl
192 MAKE=     make -f Makefile.ssl
193
194 MANDIR=$(OPENSSLDIR)/man
195 MAN1=1
196 MAN3=3
197 MANSUFFIX=
198 SHELL=/bin/sh
199
200 TOP=    .
201 ONEDIRS=out tmp
202 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
203 WDIRS=  windows
204 LIBS=   libcrypto.a libssl.a
205 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
206 SHARED_SSL=libssl$(SHLIB_EXT)
207 SHARED_LIBS=
208 SHARED_LIBS_LINK_EXTS=
209 SHARED_LDFLAGS=
210
211 GENERAL=        Makefile
212 BASENAME=       openssl
213 NAME=           $(BASENAME)-$(VERSION)
214 TARFILE=        $(NAME).tar
215 WTARFILE=       $(NAME)-win.tar
216 EXHEADER=       e_os2.h
217 HEADER=         e_os.h
218
219 # When we're prepared to use shared libraries in the programs we link here
220 # we might remove 'clean-shared' from the targets to perform at this stage
221
222 all: Makefile.ssl sub_all openssl.pc
223
224 sub_all:
225         @for i in $(DIRS); \
226         do \
227         if [ -d "$$i" ]; then \
228                 (cd $$i && echo "making all in $$i..." && \
229                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
230         else \
231                 $(MAKE) $$i; \
232         fi; \
233         done;
234
235 libcrypto$(SHLIB_EXT): libcrypto.a
236         @if [ "$(SHLIB_TARGET)" != "" ]; then \
237                 $(MAKE) SHLIBDIRS=crypto build-shared; \
238         else \
239                 echo "There's no support for shared libraries on this platform" >&2; \
240         fi
241
242 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
243         @if [ "$(SHLIB_TARGET)" != "" ]; then \
244                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
245         else \
246                 echo "There's no support for shared libraries on this platform" >&2; \
247         fi
248
249 clean-shared:
250         @for i in $(SHLIBDIRS); do \
251                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
252                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
253                         for j in $${tmp:-x}; do \
254                                 ( set -x; rm -f lib$$i$$j ); \
255                         done; \
256                 fi; \
257                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
258                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
259                         ( set -x; rm -f cyg$$i-$(SHLIB_VERSION_NUMBER)$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
260                 fi; \
261         done
262
263 link-shared:
264         @if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
265                 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
266                 for i in $(SHLIBDIRS); do \
267                         prev=lib$$i$(SHLIB_EXT); \
268                         for j in $${tmp:-x}; do \
269                                 ( set -x; \
270                                 rm -f lib$$i$$j; ln -s $$prev lib$$i$$j ); \
271                                 prev=lib$$i$$j; \
272                         done; \
273                 done; \
274         fi
275
276 build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
277
278 do_bsd-gcc-shared: do_gnu-shared
279 do_linux-shared: do_gnu-shared
280 do_gnu-shared:
281         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
282         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
283                 libs="$(LIBKRB5) $$libs"; \
284         fi; \
285         ( set -x; ${CC} ${SHARED_LDFLAGS} \
286                 -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
287                 -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
288                 -Wl,-Bsymbolic \
289                 -Wl,--whole-archive lib$$i.a \
290                 -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
291         libs="-l$$i $$libs"; \
292         done
293
294 DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
295
296 # For Darwin AKA Mac OS/X (dyld)
297 do_darwin-shared: 
298         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
299         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
300                 libs="$(LIBKRB5) $$libs"; \
301         fi; \
302         ( set -x; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
303                 lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
304                 -compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
305                 -install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
306         libs="-l`basename $$i${SHLIB_EXT} .dylib` $$libs"; \
307         echo "" ; \
308         done
309
310 do_cygwin-shared:
311         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
312         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
313                 libs="$(LIBKRB5) $$libs"; \
314         fi; \
315         ( set -x; ${CC}  -shared -o cyg$$i-$(SHLIB_VERSION_NUMBER).dll \
316                 -Wl,-Bsymbolic \
317                 -Wl,--whole-archive lib$$i.a \
318                 -Wl,--out-implib,lib$$i.dll.a \
319                 -Wl,--no-whole-archive $$libs ) || exit 1; \
320         libs="-l$$i $$libs"; \
321         done
322
323 # This assumes that GNU utilities are *not* used
324 do_alpha-osf1-shared:
325         if ${DETECT_GNU_LD}; then \
326                 $(MAKE) do_gnu-shared; \
327         else \
328                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
329                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
330                         libs="$(LIBKRB5) $$libs"; \
331                 fi; \
332                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
333                         -shared -o lib$$i.so \
334                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
335                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
336                 libs="-l$$i $$libs"; \
337                 done; \
338         fi
339
340 # This assumes that GNU utilities are *not* used
341 # The difference between alpha-osf1-shared and tru64-shared is the `-msym'
342 # option passed to the linker.
343 do_tru64-shared:
344         if ${DETECT_GNU_LD}; then \
345                 $(MAKE) do_gnu-shared; \
346         else \
347                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
348                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
349                         libs="$(LIBKRB5) $$libs"; \
350                 fi; \
351                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
352                         -shared -msym -o lib$$i.so \
353                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
354                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
355                 libs="-l$$i $$libs"; \
356                 done; \
357         fi
358
359 # This assumes that GNU utilities are *not* used
360 # The difference between tru64-shared and tru64-shared-rpath is the
361 # -rpath ${INSTALLTOP}/lib passed to the linker.
362 do_tru64-shared-rpath:
363         if ${DETECT_GNU_LD}; then \
364                 $(MAKE) do_gnu-shared; \
365         else \
366                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
367                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
368                         libs="$(LIBKRB5) $$libs"; \
369                 fi; \
370                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
371                         -shared -msym -o lib$$i.so \
372                         -rpath  ${INSTALLTOP}/lib \
373                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
374                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
375                 libs="-l$$i $$libs"; \
376                 done; \
377         fi
378
379
380 # This assumes that GNU utilities are *not* used
381 do_solaris-shared:
382         if ${DETECT_GNU_LD}; then \
383                 $(MAKE) do_gnu-shared; \
384         else \
385                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
386                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
387                         libs="$(LIBKRB5) $$libs"; \
388                 fi; \
389                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
390                   MINUSZ='-z '; \
391                   (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
392                   set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \
393                         -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
394                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
395                         $${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \
396                         $$libs ${EX_LIBS} -lc ) || exit 1; \
397                 libs="-l$$i $$libs"; \
398                 done; \
399         fi
400
401 # OpenServer 5 native compilers used
402 do_svr3-shared:
403         if ${DETECT_GNU_LD}; then \
404                 $(MAKE) do_gnu-shared; \
405         else \
406                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
407                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
408                         libs="$(LIBKRB5) $$libs"; \
409                 fi; \
410                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
411                   find . -name "*.o" -print > allobjs ; \
412                   OBJS= ; export OBJS ; \
413                   for obj in `ar t lib$$i.a` ; do \
414                     OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
415                   done ; \
416                   set -x; ${CC} ${SHARED_LDFLAGS} \
417                         -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
418                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
419                         $${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
420                 libs="-l$$i $$libs"; \
421                 done; \
422         fi
423
424 # UnixWare 7 and OpenUNIX 8 native compilers used
425 do_svr5-shared:
426         if ${DETECT_GNU_LD}; then \
427                 $(MAKE) do_gnu-shared; \
428         else \
429                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
430                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
431                         libs="$(LIBKRB5) $$libs"; \
432                 fi; \
433                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
434                   SHARE_FLAG='-G'; \
435                   (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
436                   find . -name "*.o" -print > allobjs ; \
437                   OBJS= ; export OBJS ; \
438                   for obj in `ar t lib$$i.a` ; do \
439                     OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
440                   done ; \
441                   set -x; LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
442                         ${CC} ${SHARED_LDFLAGS} \
443                         $${SHARE_FLAG} -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
444                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
445                         $${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
446                 libs="-l$$i $$libs"; \
447                 done; \
448         fi
449
450 # This assumes that GNU utilities are *not* used
451 do_irix-shared:
452         if ${DETECT_GNU_LD}; then \
453                 $(MAKE) do_gnu-shared; \
454         else \
455                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
456                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
457                         libs="$(LIBKRB5) $$libs"; \
458                 fi; \
459                 ( WHOLELIB="-all lib$$i.a -notall"; \
460                   (${CC} -v 2>&1 | grep gcc) > /dev/null && WHOLELIB="-Wl,-all,lib$$i.a,-notall"; \
461                   set -x; ${CC} ${SHARED_LDFLAGS} \
462                         -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
463                         -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
464                         $${WHOLELIB} $$libs ${EX_LIBS} -lc) || exit 1; \
465                 libs="-l$$i $$libs"; \
466                 done; \
467         fi
468
469 # This assumes that GNU utilities are *not* used
470 # HP-UX includes the full pathname of libs we depend on, so we would get
471 # ./libcrypto (with ./ as path information) compiled into libssl, hence
472 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
473 # anyway.
474 # The object modules are loaded from lib$i.a using the undocumented -Fl
475 # option.
476 #
477 # WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
478 #          by temporarily specifying "+s"!
479 #
480 do_hpux-shared:
481         for i in ${SHLIBDIRS}; do \
482         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
483                 libs="$(LIBKRB5) $$libs"; \
484         fi; \
485         ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
486                 +vnocompatwarnings \
487                 -b -z +s \
488                 -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
489                 +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
490                 -Fl lib$$i.a -ldld -lc ) || exit 1; \
491         chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
492         done
493
494 # This assumes that GNU utilities are *not* used
495 # HP-UX includes the full pathname of libs we depend on, so we would get
496 # ./libcrypto (with ./ as path information) compiled into libssl, hence
497 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
498 # anyway.
499 #
500 # HP-UX in 64bit mode has "+s" enabled by default; it will search for
501 # shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
502 #
503 do_hpux64-shared:
504         for i in ${SHLIBDIRS}; do \
505         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
506                 libs="$(LIBKRB5) $$libs"; \
507         fi; \
508         ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
509                 -b -z \
510                 -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
511                 +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
512                 +forceload lib$$i.a -ldl -lc ) || exit 1; \
513         chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
514         done
515
516 # The following method is said to work on all platforms.  Tests will
517 # determine if that's how it's gong to be used.
518 # This assumes that for all but GNU systems, GNU utilities are *not* used.
519 # ALLSYMSFLAGS would be:
520 #  GNU systems: --whole-archive
521 #  Tru64 Unix:  -all
522 #  Solaris:     -z allextract
523 #  Irix:        -all
524 #  HP/UX-32bit: -Fl
525 #  HP/UX-64bit: +forceload
526 #  AIX:         -bnogc
527 # SHAREDFLAGS would be:
528 #  GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
529 #  Tru64 Unix:  -shared \
530 #               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
531 #  Solaris:     -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
532 #  Irix:        -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
533 #  HP/UX-32bit: +vnocompatwarnings -b -z +s \
534 #               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
535 #  HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
536 #  AIX:         -G -bE:lib$$i.exp -bM:SRE
537 # SHAREDCMD would be:
538 #  GNU systems: $(CC)
539 #  Tru64 Unix:  $(CC)
540 #  Solaris:     $(CC)
541 #  Irix:        $(CC)
542 #  HP/UX-32bit: /usr/ccs/bin/ld
543 #  HP/UX-64bit: /usr/ccs/bin/ld
544 #  AIX:         $(CC)
545 ALLSYMSFLAG=-bnogc
546 SHAREDFLAGS=${SHARED_LDFLAGS} -G -bE:lib$$i.exp -bM:SRE
547 SHAREDCMD=$(CC)
548 do_aix-shared:
549         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
550         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
551                 libs="$(LIBKRB5) $$libs"; \
552         fi; \
553         ( set -x; \
554           ld -r -o lib$$i.o $(ALLSYMSFLAG) lib$$i.a && \
555           ( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
556             $(SHAREDCMD) $(SHAREDFLAGS) \
557                 -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib$$i.o \
558                 $$libs ${EX_LIBS} ) ) \
559         || exit 1; \
560         libs="-l$$i $$libs"; \
561         done
562
563 do_reliantunix-shared:
564         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
565         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
566                 libs="$(LIBKRB5) $$libs"; \
567         fi; \
568         tmpdir=/tmp/openssl.$$$$ ; rm -rf $$tmpdir ; \
569         ( set -x; \
570           ( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
571             cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
572             ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
573           ) || exit 1; \
574           cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
575         ) || exit 1; \
576         rm -rf $$tmpdir ; \
577         libs="-l$$i $$libs"; \
578         done
579
580 openssl.pc: Makefile.ssl
581         @ ( echo 'prefix=$(INSTALLTOP)'; \
582             echo 'exec_prefix=$${prefix}'; \
583             echo 'libdir=$${exec_prefix}/lib'; \
584             echo 'includedir=$${prefix}/include'; \
585             echo ''; \
586             echo 'Name: OpenSSL'; \
587             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
588             echo 'Version: '$(VERSION); \
589             echo 'Requires: '; \
590             echo 'Libs: -L$${libdir} -lssl -lcrypto $(LIBKRB5) $(EX_LIBS)'; \
591             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
592
593 Makefile.ssl: Makefile.org
594         @echo "Makefile.ssl is older than Makefile.org."
595         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
596         @false
597
598 libclean:
599         rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
600
601 clean:  libclean
602         rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
603         @for i in $(DIRS) ;\
604         do \
605         if [ -d "$$i" ]; then \
606                 (cd $$i && echo "making clean in $$i..." && \
607                 $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
608                 rm -f $(LIBS); \
609         fi; \
610         done;
611         rm -f openssl.pc
612         rm -f speed.* .pure
613         rm -f $(TARFILE)
614         @for i in $(ONEDIRS) ;\
615         do \
616         rm -fr $$i/*; \
617         done
618
619 makefile.one: files
620         $(PERL) util/mk1mf.pl >makefile.one; \
621         sh util/do_ms.sh
622
623 files:
624         $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
625         @for i in $(DIRS) ;\
626         do \
627         if [ -d "$$i" ]; then \
628                 (cd $$i && echo "making 'files' in $$i..." && \
629                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
630         fi; \
631         done;
632
633 links:
634         @$(TOP)/util/point.sh Makefile.ssl Makefile
635         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
636         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
637         @for i in $(DIRS); do \
638         if [ -d "$$i" ]; then \
639                 (cd $$i && echo "making links in $$i..." && \
640                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
641         fi; \
642         done;
643
644 gentests:
645         @(cd test && echo "generating dummy tests (if needed)..." && \
646         $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
647
648 dclean:
649         rm -f *.bak
650         @for i in $(DIRS) ;\
651         do \
652         if [ -d "$$i" ]; then \
653                 (cd $$i && echo "making dclean in $$i..." && \
654                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
655         fi; \
656         done;
657
658 rehash: rehash.time
659 rehash.time: certs
660         @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
661                 export OPENSSL OPENSSL_DEBUG_MEMORY; \
662                 LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
663                 DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
664                 SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
665                 LIBPATH="`pwd`:$$LIBPATH"; \
666                 if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
667                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
668                 $(PERL) tools/c_rehash certs)
669         touch rehash.time
670
671 test:   tests
672
673 tests: rehash
674         @(cd test && echo "testing..." && \
675         $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
676         @LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
677         DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
678         SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
679         LIBPATH="`pwd`:$$LIBPATH"; \
680         if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
681         export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
682         apps/openssl version -a
683
684 report:
685         @$(PERL) util/selftest.pl
686
687 depend:
688         @for i in $(DIRS) ;\
689         do \
690         if [ -d "$$i" ]; then \
691                 (cd $$i && echo "making dependencies $$i..." && \
692                 $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
693         fi; \
694         done;
695
696 lint:
697         @for i in $(DIRS) ;\
698         do \
699         if [ -d "$$i" ]; then \
700                 (cd $$i && echo "making lint $$i..." && \
701                 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
702         fi; \
703         done;
704
705 tags:
706         @for i in $(DIRS) ;\
707         do \
708         if [ -d "$$i" ]; then \
709                 (cd $$i && echo "making tags $$i..." && \
710                 $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
711         fi; \
712         done;
713
714 errors:
715         $(PERL) util/mkerr.pl -recurse -write
716         (cd crypto/engine; $(MAKE) PERL=$(PERL) errors)
717
718 stacks:
719         $(PERL) util/mkstack.pl -write
720
721 util/libeay.num::
722         $(PERL) util/mkdef.pl crypto update
723
724 util/ssleay.num::
725         $(PERL) util/mkdef.pl ssl update
726
727 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
728         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
729 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
730         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
731
732 TABLE: Configure
733         (echo 'Output of `Configure TABLE'"':"; \
734         $(PERL) Configure TABLE) > TABLE
735
736 update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
737
738 # Build distribution tar-file. As the list of files returned by "find" is
739 # pretty long, on several platforms a "too many arguments" error or similar
740 # would occur. Therefore the list of files is temporarily stored into a file
741 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
742 # tar does not support the --files-from option.
743 tar:
744         find . -type d -print | xargs chmod 755
745         find . -type f -print | xargs chmod a+r
746         find . -type f -perm -0100 -print | xargs chmod a+x
747         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
748         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
749         tardy --user_number=0  --user_name=openssl \
750               --group_number=0 --group_name=openssl \
751               --prefix=openssl-$(VERSION) - |\
752         gzip --best >../$(TARFILE).gz; \
753         rm -f ../$(TARFILE).list; \
754         ls -l ../$(TARFILE).gz
755
756 tar-snap:
757         @$(TAR) $(TARFLAGS) -cvf - \
758                 `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` |\
759         tardy --user_number=0  --user_name=openssl \
760               --group_number=0 --group_name=openssl \
761               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
762         ls -l ../$(TARFILE)
763
764 dist:   
765         $(PERL) Configure dist
766         @$(MAKE) dist_pem_h
767         @$(MAKE) SDIRS='${SDIRS}' clean
768         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
769
770 dist_pem_h:
771         (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
772
773 install: all install_docs
774         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
775                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
776                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
777                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
778                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
779                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
780                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private \
781                 $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
782         @for i in $(EXHEADER) ;\
783         do \
784         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
785         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
786         done;
787         @for i in $(DIRS) ;\
788         do \
789         if [ -d "$$i" ]; then \
790                 (cd $$i; echo "installing $$i..."; \
791                 $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' install ); \
792         fi; \
793         done
794         @for i in $(LIBS) ;\
795         do \
796                 if [ -f "$$i" ]; then \
797                 (       echo installing $$i; \
798                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
799                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
800                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
801                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
802                 fi; \
803         done;
804         @if [ -n "$(SHARED_LIBS)" ]; then \
805                 tmp="$(SHARED_LIBS)"; \
806                 for i in $${tmp:-x}; \
807                 do \
808                         if [ -f "$$i" -o -f "$$i.a" ]; then \
809                         (       echo installing $$i; \
810                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
811                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
812                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
813                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
814                                 else \
815                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
816                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
817                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
818                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
819                                         cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
820                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
821                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
822                                 fi ); \
823                         fi; \
824                 done; \
825                 (       here="`pwd`"; \
826                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
827                         set $(MAKE); \
828                         $$1 -f $$here/Makefile link-shared ); \
829                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
830                         echo 'OpenSSL shared libraries have been installed in:'; \
831                         echo '  $(INSTALLTOP)'; \
832                         echo ''; \
833                         sed -e '1,/^$$/d' doc/openssl-shared.txt; \
834                 fi; \
835         fi
836         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
837         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
838
839 install_docs:
840         @$(PERL) $(TOP)/util/mkdir-p.pl \
841                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
842                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
843                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
844                 $(INSTALL_PREFIX)$(MANDIR)/man7
845         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
846         here="`pwd`"; \
847         filecase=; \
848         if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
849                 filecase=-i; \
850         fi; \
851         for i in doc/apps/*.pod; do \
852                 fn=`basename $$i .pod`; \
853                 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
854                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
855                 (cd `$(PERL) util/dirname.pl $$i`; \
856                 sh -c "$$pod2man \
857                         --section=$$sec --center=OpenSSL \
858                         --release=$(VERSION) `basename $$i`") \
859                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
860                 $(PERL) util/extract-names.pl < $$i | \
861                         grep -v $$filecase "^$$fn\$$" | \
862                         grep -v "[      ]" | \
863                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
864                          while read n; do \
865                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
866                          done); \
867         done; \
868         for i in doc/crypto/*.pod doc/ssl/*.pod; do \
869                 fn=`basename $$i .pod`; \
870                 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
871                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
872                 (cd `$(PERL) util/dirname.pl $$i`; \
873                 sh -c "$$pod2man \
874                         --section=$$sec --center=OpenSSL \
875                         --release=$(VERSION) `basename $$i`") \
876                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
877                 $(PERL) util/extract-names.pl < $$i | \
878                         grep -v $$filecase "^$$fn\$$" | \
879                         grep -v "[      ]" | \
880                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
881                          while read n; do \
882                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
883                          done); \
884         done
885
886 # DO NOT DELETE THIS LINE -- make depend depends on it.