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